diff --git a/simplegallery.module b/simplegallery.module
index 198c154..9dc206f 100644
--- a/simplegallery.module
+++ b/simplegallery.module
@@ -311,7 +311,7 @@ function theme_simplegallery_images($nodes, $page, $pagesize){
     //figure out where we should be in our counter
     // we have to add +1 to page so we will get our pager correct
     $currentpage = $page + 1; 
-    $lastitem = $currentpage * $pagesize; 
+    $lastitem = ($currentpage * $pagesize) - 1; 
     $firstItem = ($lastitem - $pagesize) + 1; 
     $rows = array();
     $i = 0;
@@ -381,4 +381,4 @@ function simplegallery_select_nodes($tids = array(), $order = 'n.sticky DESC, n.
   }
 
   return $result;
-}
\ No newline at end of file
+}
