Model/Picture.php
public function uploadFile(
        $path = null,
        $album_id = null,
        $filename,
        $tmp_name = null,
        $width = 0,
        $height = 0,
        $action,
        $save = false,
        $main_id = null,
        $style = 'full'
    ) {

        if (!$album_id) {
            throw new ForbiddenException("The album ID is required");
        }

        if (!$path) {
            throw new ForbiddenException("The PATH is required");
        }

        if (!$tmp_name) {
            throw new ForbiddenException("The TMP_NAME is required");
        }

        if (copy($tmp_name, $path)) {
            # Resize only if the width or the height has benn informed
            if (!!$width || !!$height) {
                # Image transformation / Manipulation
                try {
                    $path = $this->resizeCrop($path, $width, $height, $action);
                } catch (InternalErrorException $e) {
                    throw new ForbiddenException($e->getMessage());
                }
            }
            if ($save) {
                return $this->savePicture($album_id, $filename, $path, $main_id, $style);
            }
            return null;
        } else {
            throw new ForbiddenException("Upload failed. Check your folders permissions.");
        }
    }
public function uploadFile(
        $path = null,
        $album_id = null,
        $filename,
        $tmp_name = null,
        $width = 0,
        $height = 0,
        $action,
        $save = false,
        $main_id = null,
        $style = 'full'
    ) {

        if (!$album_id) {
            throw new ForbiddenException("The album ID is required");
        }

        if (!$path) {
            throw new ForbiddenException("The PATH is required");
        }

        if (!$tmp_name) {
            throw new ForbiddenException("The TMP_NAME is required");
        }

        if (copy($tmp_name, $path)) {
            # Resize only if the width or the height has benn informed
            if (!!$width || !!$height) {
                # Image transformation / Manipulation
                try {
                    $path = $this->resizeCrop($path, $width, $height, $action);
                } catch (InternalErrorException $e) {
                    throw new ForbiddenException($e->getMessage());
                }
            }
            if ($save) {
                return $this->savePicture($album_id, $filename, $path, $main_id, $style);
            }
            return null;
        } else {
            throw new ForbiddenException("Upload failed. Check your folders permissions.");
        }
    }
Upload the image to WWW_ROOT/files/gallery/{album_id}/picture.jpg
Optionaly save it to database

@param $path
@param $album_id
@param $filename
@param $filesize
@param $tmp_name
@param int $width
@param int $height
@param $action
@param bool $save
@param null $main_id
@param string $style
@return mixed|null
@throws ForbiddenException