OK, sounds like maybe you've incorporated code you got from somewhere else? If it saves information about each image to a database, then you could modify that code to save the username (and comment) and then change the part that reads the image info to get that data and add it to the display.
If it doesn't use a database (maybe it just looks for images in a certain directory), then you'd need to find a way to save the username and comment, either to a database table or maybe create a second file for each image that contains some text information.