Well, as the image names have to be unique you could retain the image names (you say you are happy with this) then prepend the user id number.
ie user 23 :
/images/23_fluffy_kitten.jpg
/images/23_big_dog.jpg
Either that or construct a folder for each new user:
/images/23/fluffy_kitten.jpg
/images/23/big_dog.jpg
From your description I am guessing that you create the new user account and store all the images at the same time - is that so?
If so you create the new users, grab the new users id using last insert id and then store/rename the images accordingly.
There seems an awful lot to go wrong here though, I'd consider doing it in 2 stages.
Create new user account, then direct to the upload form and have a hidden field in the upload form containing the user id:
PHP Code:
<input type=hidden name=user_id value=23 />
and simply grab $_POST['user_id'] as you do the upload and add it to the path as I described above.
Bookmarks