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
drwxrwxrwt 2 admin4 admin4 4.0K Apr 19 14:01 tmp
so its set as the right owner and set as 777 for permissions and still get the issue