Bueno hize unos cambios a esta clase y le quite todo lo que tenga que ver con Model de CI. y lo deje así:
   
Código PHP:
Ver original<?php
class Gallery_model{
 
    public $gallery_path;
    public $gallery_path_url;
 
    function __construct() {
        $this->gallery_path = realpath(APPPATH 
. "../img");         $this->gallery_path_url = base_url() . "img";
    }
 
    function do_upload($carpeta) {        
            'allowed_types' => 'jpg|jpeg|gif|png',
            'upload_path' => $this->gallery_path."\\".$carpeta,
            'max_size' => 2000
        );
 
        $this->load->library('upload', $config);
        $this->upload->do_upload();
        $image_data = $this->upload->data();
            'source_image' => $image_data['full_path'],
            'new_image' => $this->gallery_path."\\".$carpeta. '/thumbs',
            'maintain_ration' => true,
            'width' => 160,
            'height' => 180
        );
        
        $this->load->library('image_lib', $config);
        $this->image_lib->resize();
        $data = $image_data["file_name"];
        return $data;        
    }
 
}
  
Y me dice que galery_path no esta definido.