XML and Flash Photogallery

I am working on a photo slideshow in CS3 for my girlfriend’s portfolio based on the one in this tutorial:

http://www.kirupa.com/developer/mx2004/xml_flash_photogallery2.htm

I am trying to get the next button to go back to the first photo when it reaches the last photo. But my actionscript knowledge is pretty weak, and I keep messing it up. Otherwise, the tutorial was just what I was looking for.

If anyone knows a simple way to modify the actionscript (see above link and scroll down) to make this work I would be greatly appreciative!!!