XML Gallery : modify Previous/Next buttons

Hello,

Thanks for the great tutorial, Kirupa.

I have a quick question, -

Once the user has reached the final image of the gallery, is there a way to make the “Next” button disappear? The same for “Previous” button, is there a way to not display it during the first image in the gallery?

thanks in advance,

Magomed