your photos table would need to have a column that relates to the users table to create the photo to user relationship by storing the users ID value.
when a user logs in, their ID is stored in a session variable.
you could query the Photos table to return photos where the user id session matches the ID stored in the relation column.