I am creating a slideshow for any node with multiple images, uploaded through imagefield. When a photo is clicked on and the slideshow opens, I'd like the image-data field to be shown as the caption.

My code to create the image looks like this:

             $caption = check_plain($item['title']).' <br /> '. check_plain($node->field_image[0][data][title]) .' <br /><br />PHOTO GALLERY. <br /> Use right and left arrows to navigate';

The problem I have is that when the arrow is clicked and the next picture is shown, the caption stays the same because it's calling field_image[0], which as I understand it says "first image only".. basically.

Is there a way I can alter that code so that the field_image-data changes with the photo?