if the database is empty and the images are in the folder and did correctly upload it sounds to be an issue with the update call.
I dont know anything about this snippet but that would be my guess from the problem description...
If the page comes up blank when you upload an image, there is some parsing error happening and it should be in the event log.. I don’t know how to help more..
"He can have a lollipop any time he wants to. That's what it means to be a programmer."