diff --git a/sites/all/modules/galleryformatter/galleryformatter.module b/sites/all/modules/galleryformatter/galleryformatter.module
index 6f91ec3..df5b9d7 100644
--- a/sites/all/modules/galleryformatter/galleryformatter.module
+++ b/sites/all/modules/galleryformatter/galleryformatter.module
@@ -163,6 +163,8 @@ function galleryformatter_field_formatter_view($entity_type, $entity, $field, $i
   // prepare the renderable array
   $renderitems = array();
   $renderitems['thumbs'] = array();
+  $max_height = 0;
+  $max_width = 0;
   foreach ($items as $delta => $item){
     /*
      *  prepare slides
@@ -239,8 +241,12 @@ function galleryformatter_field_formatter_view($entity_type, $entity, $field, $i
       );
       $renderitems['thumbs'][$delta]['hash_id'] = 'slide-' . $delta . '-' . $slideset_id;
     }
+    $image_dimension = galleryformatter_getimage_dimensions($settings['slide_style'], $item['uri']);
+    $max_height = ($max_height > $image_dimension['height']) ? $max_height : $image_dimension['height'];
+    $max_width = ($max_width > $image_dimension['width']) ? $max_width : $image_dimension['width'];
   }
-  $dimensions['slides'] = galleryformatter_getimage_dimensions($settings['slide_style'], $items[0]['uri']);
+  // $dimensions['slides'] = galleryformatter_getimage_dimensions($settings['slide_style'], $items[0]['uri']);
+  $dimensions['slides'] = array('height' => $max_height, 'width' => $max_width);
 
   if($num_of_images > 1){
    $dimensions['thumbs'] = galleryformatter_getimage_dimensions($settings['thumb_style'], $items[0]['uri']);
diff --git a/sites/all/modules/galleryformatter/theme/galleryformatter.js b/sites/all/modules/galleryformatter/theme/galleryformatter.js
index 4770f96..2e79675 100644
--- a/sites/all/modules/galleryformatter/theme/galleryformatter.js
+++ b/sites/all/modules/galleryformatter/theme/galleryformatter.js
@@ -46,6 +46,25 @@ Drupal.galleryformatter.prepare = function(el) {
         });
     });
     var $thumbslinks = $('a', $thumbsLi);
+    
+    $('li.gallery-slide').each(function(){
+    	// get the height of the image within the slide
+    	var img_height = $(this).find('img').height();
+    	// get the height of the slide
+    	var slide_height = $(this).closest('div.gallery-slides').height();
+    	// calculate the top css
+    	var top = (slide_height - img_height) / 2;
+    	// define the top css
+    	$(this).css('top', top);
+    	// get the width of the image within the slide
+    	var img_width = $(this).find('img').width();
+    	// get the width of the slide
+    	var slide_width = $(this).closest('div.gallery-slides').width();
+    	// calculate the left css
+    	var left = (slide_width - img_width) / 2;
+    	// define the left css
+    	$(this).css('left', left);
+    })
 
     /*
      * @TODO:
