If you wanted to loop through the images.try something like below.
Append the user id's of your User table with the image name (like image1,image2) and so taht we can easily identify which image belongs to which user..