It all matters what your application will be doing.
I think the best thing for your application would be to generate a random name for each picture being uploaded then create a nested folder structure to store the images. For example if a user uploads a photo and you assign it the name 1234.png. You can then store this picture in the folder structure //1/2/1234.png, similarly, ab234.png would be stored in //a/b/ab234.png. This structure allows for growth, minimizes the number of folders, and minimizes the number of files per folder.
To index the files you can use a MySql database. Within the MySql database you can have a table that links userIds to picture locations on disk. Your table would would have a few columns . For user '1' with picture 1234.png, the table entry would be <1,1234.png,a/b>