Actually the file I got the code from was uploadphoto.php but mistakenly said bulkupload so that line is there. I have tried uploading a single file and it works but did not do bulkupload since you have not specifically stated you where doing bulkuploading. I would say the line you note should be there in bulkupload and that is the issue.
It works for me on my test site.
http://www.reeftalk.com/gallery/show.../1297/ppuser/1 http://www.reeftalk.com/gallery/show.../1298/ppuser/1
I will pass along for the build to be updated and $theext to be added. Really in reality we dont even need to do that cause we could do the query to check $realname. We have not used $theext in so long when we use to append thumb and med on images so its a carry over.