I am attaching an image that shows how the gallery would like like
So as you see we have thumbnails both on the bottom of the page as well as on the left of the page. The user clicks on any of the two thumbnail regions and the image loads on the big image placeholder. Just image on the sample that the images on both thumbnails are for the same gallery. The next and previous button on the top of the left region thumbnail are moving the big image placeholder to the next image on the array. The arrows on the bottom of the left (where it says 19 photos) are to move to the next page of the thumbnails on that region.
The Next and previous buttons on the bottom thumbnail region move to the next big image.
The images are stored in a database with the path, and they have caption texts connected with them.
One last requirement is that on the previous page the user can select out of a random 5 pictures in which if they click on one of them this image gallery preloads and displays the picture directly. So I need to have some kind of and argument passing between the previus page and the gallery that will say to the script which image to preload. If not, then the first picture of the gallery will be shown.
I hope this is clear enough. Thank you for your time and any help will be appreciatted.