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.
I am afraid that goes beyond the scope of the class itself. The class only deals with the upload, but not with any updates you may do in your database.
Try to print the $_FILES array, so that you can see which pictures have been uploaded or not, and then modify your SQL statement accordingly.
Try to print the $_FILES array, so that you can see which pictures have been uploaded or not, and then modify your SQL statement accordingly.