So the fiddle wasnt a whole lot of help but thanks for posting what code you could...
- using class naming conventions that are defaults in CSS such as class="image" is a bad idea.
- I couldnt do much with the fiddle... But i went to the demo and made this how i think you want.
Your going to want to add a wrapper div around all of the gallery
HTML
<body>
<div class="galleryContainer">
//this is where all the code in the gallery goes including the container on the gallery because it is dynamically changed
</div>
</body>
CSS
.galleryContainer{
width: 50%; //or whatever you would like
height: 600px; //or whatever you would like
margin: 0 auto; //center the gallery horizontally
overflow: auto; //allows you to scroll the gallery when some pictures cant be displayed
}
the previous code also allowed all re sizing and mobile compatibility to work fine. Hope this helped