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
php_value max_execution_time 30000
ini_set ('max-execution_time', '30000' )
Try to add the following in your .htaccess file:
(the number is the number of seconds).
If that does not work either (some hosts forbid this as well), try to add the following to your script, before processing the uploads: