I haven't finish all your code but I spot something that is not suitable in HTML - In the PHOTO_FORM, you have photo_filename[] as you input name of the file. As HTML is not like php, it will not take your file data into an array. You may want to change it to photo_filename1 and photo_filename2 for the second image.
Then in your upload script, use $_POST['photo_filename1'] and $_POST['photo_filename2'] to retrive it. If you have to upload many images at once, you can use For loop to remove the need of repeating scripts.
Post your finding here again if it still not working.
I haven't finish all your code but I spot something that is not suitable in HTML - In the PHOTO_FORM, you have photo_filename[] as you input name of the file.
No!!!!
You can use that in HTML. photo_filename[] is perfectly legal in HTML. It will store all the selected options into an array. There is nothing wrong with that.