Index: theme/theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_gallery/theme/theme.inc,v
retrieving revision 1.2.2.33
diff -u -r1.2.2.33 theme.inc
--- theme/theme.inc	13 Nov 2010 19:39:38 -0000	1.2.2.33
+++ theme/theme.inc	16 Nov 2010 02:36:09 -0000
@@ -36,42 +36,23 @@
   return $output;
 }
 
-function theme_gallery_image_navigator($navigator, $image) {
-  $col1 = array('data' => t("%current of %total", array('%current' => $navigator['current'], '%total' => $navigator['total'])),
-    'class' => 'image-navigator-left');
-  if ($navigator['total'] <= 1) {
-    $col2 = array('data' => t('&nbsp;'), 'class' => 'image-navigator-first');
-    $col3 = array('data' => t('&nbsp;'), 'class' => 'image-navigator-prev');
-    $col4 = array('data' => t('&nbsp;'), 'class' => 'image-navigator-next');
-    $col5 = array('data' => t('&nbsp;'), 'class' => 'image-navigator-last');
-  } 
-  else {
-    $extra = array();
-    $relationship = node_gallery_get_relationship(NULL, $image->type);
-    if ($relationship['settings']['node_images_page_fragment']) {
-      $extra = array('fragment' => 'node-inner');
-    }
-    $prev = '&nbsp;';
-    $next = '&nbsp;';
-    $first = '&nbsp;';
-    $last = '&nbsp;';
-    if (isset($navigator['prev_nid'])) {
-      $prev = l(t('< Previous'), 'node/'. $navigator['prev_nid'], $extra);
-      $first = l(t('<< First'), 'node/'. $navigator['first_nid'], $extra);
-    }
-    if (isset($navigator['next_nid'])) {
-      $next = l(t('Next >'), 'node/'. $navigator['next_nid'], $extra);
-      $last = l(t('Last >>'), 'node/'. $navigator['last_nid'], $extra);
-    }
-    $col2 = array('data' => $first, 'class' => 'image-navigator-first');
-    $col3 = array('data' => $prev, 'class' => 'image-navigator-prev');
-    $col4 = array('data' => $next, 'class' => 'image-navigator-next');
-    $col5 = array('data' => $last, 'class' => 'image-navigator-last');
+function template_preprocess_gallery_image_navigator(&$variables) {
+  $extra = array();
+  $relationship = node_gallery_get_relationship(NULL, $variables['image']->type);
+  if ($relationship['settings']['node_images_page_fragment']) {
+    $extra = array('fragment' => 'node-inner');
   }
-  $col6 = array('data' => node_gallery_operations('image', $image), 'class' => 'image-navigator-right');
-  $rows[] = array($col1, $col2, $col3, $col4, $col5, $col6);
-
-  return theme('table', NULL, $rows, array('class' => 'image-navigator')); 
+  if (isset($variables['navigator']['prev_nid'])) {
+    $variables['prev_link'] = url('node/'. $variables['navigator']['prev_nid'], $extra);
+    $variables['first_link'] = url('node/'. $variables['navigator']['first_nid'], $extra);
+  }
+  if (isset($variables['navigator']['next_nid'])) {
+    $variables['next_link'] = url('node/'. $variables['navigator']['next_nid'], $extra);
+    $variables['last_link'] = url('node/'. $variables['navigator']['last_nid'], $extra);
+  }
+  $variables['gallery_link'] = url('node/'. $variables['navigator']['parent']);
+  $gallery = node_load($variables['navigator']['parent']);
+  $variables['gallery_title'] = check_plain($gallery->title);
 }
 
 function theme_node_gallery_sort_images_form($form) {
Index: node_gallery.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_gallery/node_gallery.css,v
retrieving revision 1.4.2.5
diff -u -r1.4.2.5 node_gallery.css
--- node_gallery.css	22 Jul 2010 15:46:12 -0000	1.4.2.5
+++ node_gallery.css	16 Nov 2010 02:36:08 -0000
@@ -8,12 +8,12 @@
 .image-navigator ul.gallery-operations {border:none; padding-bottom:0}
 .image-preview {text-align:center}
 
-table.image-navigator td.image-navigator-left {width:30%}
+table.image-navigator td.image-navigator-position {width:30%}
 table.image-navigator td.image-navigator-first {width:9%; text-align:center}
 table.image-navigator td.image-navigator-prev {width:14%; text-align:center}
 table.image-navigator td.image-navigator-next {width:9%; text-align:center}
 table.image-navigator td.image-navigator-last {width:9%; text-align:center}
-table.image-navigator td.image-navigator-right {width:30%}
+table.image-navigator td.image-navigator-parent-gallery {width:30%; text-align:right}
 
 li.image-sorting-list-item { width: 50px; height: 50px; padding: 5px; float: left; list-style: none inside; background: none; }
 ul.image-sorting-list { list-style-type: none }
Index: node_gallery.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_gallery/node_gallery.inc,v
retrieving revision 1.2.2.63
diff -u -r1.2.2.63 node_gallery.inc
--- node_gallery.inc	14 Nov 2010 18:44:01 -0000	1.2.2.63
+++ node_gallery.inc	16 Nov 2010 02:36:09 -0000
@@ -333,7 +333,7 @@
   $navigator['next_nid'] = node_gallery_get_next_image($gid, $nid, $reset);
   $navigator['first_nid'] = node_gallery_get_first_image($gid, $reset);
   $navigator['last_nid'] = node_gallery_get_last_image($gid, $reset);
-        
+  $navigator['image_nids'] = node_gallery_get_image_list($gid, $reset);
   return $navigator;
 }
 
Index: node_gallery.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_gallery/node_gallery.module,v
retrieving revision 1.18.2.114
diff -u -r1.18.2.114 node_gallery.module
--- node_gallery.module	14 Nov 2010 19:13:47 -0000	1.18.2.114
+++ node_gallery.module	16 Nov 2010 02:36:09 -0000
@@ -249,6 +249,7 @@
 
   $themes = array(
     'gallery_image_navigator' => array(
+      'template' => 'gallery-image-navigator',
       'arguments' => array('navigator' => NULL, 'image' => NULL),
     ),
     'node_gallery_manage_images_form' => array(
@@ -1012,10 +1013,6 @@
         );
       }
       break;
-    case 'image':
-      $image_node = $a2;
-      $items[] = array('title' => t('Back to gallery'), 'href' => 'node/'. $image_node->gid);
-      break;
   }
   return theme('links', $items, array('class' => 'gallery-operations'));
 }
Index: theme/gallery-image-navigator.tpl.php
===================================================================
RCS file: theme/gallery-image-navigator.tpl.php
diff -N theme/gallery-image-navigator.tpl.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ theme/gallery-image-navigator.tpl.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,37 @@
+<?php
+// $Id$
+
+/**
+ * @file galler-image-navigator.tpl.php
+ * Default theme implementation to show a 6 column table containing the image navigator.
+ * 
+ * Available variables:
+ * @todo: fill this in
+ * 
+ * @see theme_preprocess_gallery_image_navigator()
+ */
+?>
+<table id="node-gallery-image-navigator" class="image-navigator">
+  <tbody>
+    <tr class="odd">
+      <td class="image-navigator-position">
+        <?php print t("%current of %total", array('%current' => $navigator['current'], '%total' => $navigator['total'])); ?>
+      </td>
+      <td class="image-navigator-first">
+        <?php print isset($first_link) ? '<a href="'. $first_link .'">&lt;&lt; '. t('First') .'</a>' : '&nbsp;'; ?>
+      </td>
+      <td class="image-navigator-prev">
+        <?php print isset($prev_link) ? '<a href="'. $prev_link .'">&lt; '. t('Previous') .'</a>' : '&nbsp;'; ?>
+      </td>
+      <td class="image-navigator-next">
+        <?php print isset($next_link) ? '<a href="'. $next_link .'">'. t('Next') .' &gt;</a>' : '&nbsp;'; ?>
+      </td>
+      <td class="image-navigator-last">
+        <?php print isset($last_link) ? '<a href="'. $last_link .'">'. t('Last') .' &gt;&gt;</a>' : '&nbsp;'; ?>
+      </td>
+      <td class="image-navigator-parent-gallery">
+        <?php print '<a href="'. $gallery_link .'">'. t("Back to gallery") .'</a>'; ?>
+      </td>
+    </tr>
+  </tbody>
+</table>
