line 334:
unset(sizeof($_SESSION['uploadedFiles']));
should be:
unset($_SESSION['uploadedFiles']);
the other problem on the page is that you have added the array loop around the insert and the MT behaviors, the for each loop should only be added around the insert record behavior for the images.
Go back to the beginning and get the page working with every thing except the image upload and the insert for the image names, once you have that in place, add the image upload and the insert for the image names.
The reality is that the code I gave in my previous reply to this thread is not supported code, you will need to have an understanding of what that code is doing to be successful using it.