What is best way to organize this mulptiple image gallery on one page

i have a listed page where each main photo has thumbnails next to it

i am having trouble getting these seperate image galleries to function on the same page. how can i change the java so that these all work without affecting the others. i tried changing the call functions i dont know how to do this.

thanks for the help:p:D

here is my pagethis page