I assume "album1" is a div or something that holds all the images?
This code here
$(this).children().attr("id") is getting all of the children of the element that was clicked, then you are asking for the id, it will always return the id of the first child.
If that doesn't help you may want to post the actual markup that you're dealing with.
Dave
----------------------------------------------