About the xml photo gallery combine with thumbnail and Slideshow

[SIZE=2][COLOR=Black] I try to use the xml photo gallery tutorial
and combine with the slideshow and thumbnail features together. It’s fine. But when I click the pervious and next button twice or more in the same time, the images will skip.

So, how can I [/COLOR][/SIZE][SIZE=2][COLOR=Black]improve it? It’s the problem happen in[/COLOR][/SIZE][SIZE=2][COLOR=Black] the previmage and nextimage function?
[/COLOR][/SIZE]