Lewi-p's XML Reader/Slideshow help

Hello friends,

I am working on lewi-p’s slideshow gallery. I have modified it to 6 items. But when the slideshow comes to the last box, the box remains active. I want it to be disabled.

You can download all the files from below:


Can you please help me?