--- doc/templates.html	2003-03-15 23:53:43.000000000 +0100
+++ doc/templates.html.mod	2007-08-08 07:02:30.000000000 +0200
@@ -341,7 +341,7 @@
                     <td valign="top"><tt>COLUMNS</tt><br>
                     </td>
                     <td valign="top">LOOP variable for thumbnail columns.
-The following three variables are available for each cell:<br>
+The following four variables are available for each cell:<br>
                     </td>
                   </tr>
                   <tr>
@@ -362,6 +362,14 @@
                   </tr>
                   <tr>
                     <td valign="top">
+                    <blockquote><tt>IMG_NR</tt><br>
+                    </blockquote>
+                    </td>
+                    <td valign="top">Sequence number of current image (in sync with the image page)<br>
+                    </td>
+                  </tr>
+                  <tr>
+                    <td valign="top">
                     <blockquote><tt>IMG_CAPTION</tt><br>
                     </blockquote>
                     </td>
--- mkgallery.pl	2003-03-16 00:07:00.000000000 +0100
+++ mkgallery.pl.mod	2007-08-08 06:42:35.000000000 +0200
@@ -463,7 +463,7 @@
 	$row{IMG_URL}        = encode_entities(uri_escape($image)) . '.html';
 	$row{IMG_THUMB_PATH} = '../thumbs/' . encode_entities(uri_escape($img->[$i]->{THUMB}));
 	$row{IMG_CAPTION}    = encode_entities($image_cap);
-
+	$row{IMG_NR}         = $i+1;
 
 	if ( $i - $range->{FIRST} && ($i - $range->{FIRST}) % $P{cols} == 0 ) {
 	    my @r = @row;
