Index: gallery_menu.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/gallery/gallery_menu/Attic/gallery_menu.module,v
retrieving revision 1.1.2.17
diff -u -r1.1.2.17 gallery_menu.module
--- gallery_menu.module	15 Oct 2007 09:39:53 -0000	1.1.2.17
+++ gallery_menu.module	18 Oct 2007 22:48:25 -0000
@@ -153,9 +153,14 @@
  */
 function _gallery_menu_album_path($id) {
   $path = urldecode(gallery_generate_url(array('itemId' => $id), FALSE, FALSE));
-  $path = rtrim(substr($path, strlen(base_path())), '/');
+  // Strip off the base path ...
+  $path = substr($path, strlen(base_path()));
+  // ... and additional parameter (e.g. session id, etc.)
+  if (($pos = strrpos($path, '/')) !== FALSE) {
+    $path = substr($path, 0, $pos + 1);
+  }
   
-  return $path;
+  return rtrim($path, '/');
 }
 
 /**
