XML photo gallery w/ Loop

Hi,
I’ve made a photo gallery using the Kirupa tutorial. But my client wants the photos to be displayed in an “endless loop” instead of from pic 1 to pic 30. When your watching pic 1 and you press “previous”, he wants it to jump to pic 30. When your on pic 30 and you press “next”, he wants it to go to pic 1. Actually, he does not want to display any picture numbers at all.

Can anyone help me tweek the code, so that the pictures “loop” like that? Also, would it be possible to make the pictures start playing by themselves, without the user pressing the “next” button?

/wtk