class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
more info about the class
$this->file_src_mime = (is_array($info) && array_key_exists('mime', $info) ? $info['mime'] : NULL);
You must have an old version of the class, because from version 0.24 there is a check to make sure that the $info variable is an array: