Well, getting images is pretty easy.
First, in the page, you have to have
<input type=file name="Image1">
<input type=file name="Image2">
<input type=file name="Image3">
...
Next, the file will be placed on your server upon submit, and PHP makes $Image1 into the local filename of that copy.
You parse out the file name however you care to (consult PHP manual..), and generate the unique ID's using randoms (a good way to do this is make a query like 'SELECT ImgID FROM IMAGES, and check each of the results against the random generated one. If it's unique, keep it and otherwise, make a new one and check again. the BigO for this gets huge, but it's a nice secure way. alternatively, you can make IDs and auto-increment them with the database, but then you have to requery the database to get the new ID..)