You can create a folder for a username as soon as the user registers for that name.
For example a user with username ABC registers
you create a folder called ABC and copy an index.php file to that folder.
then his images are moved to that folder as he uploads them.
the index.php for...