Help with xml buttons

Hi all.
Sorry if this question has been asked before - I couldn’t find it in a search. I am using Scotty’s multiple gallery example, but would like to add “previous” and “next” buttons to it. I have looked at the other gallery examples with these buttons, but can not figure out how to make it work with this particular example. The original can be found here:

Any help would be very much appreciated.