I did a project where I was uploading binary files. The file didnt actually get stored in the database (we used Oracle). We hashed the filename, creating a unique name, stored the file on the filesystem under that name and put the file names in the database.
It also seems that your making a picture gallery. There are alot of picture gallery code out there.
Check out HotScripts.com
Hot Scripts - Image galleries
Theres a script called Picture Scroller, it seems to fit your needs, and you can always modify it to do whatever you want.