Index: /extensions/greydragon/admin/admin.tpl
===================================================================
--- /extensions/greydragon/admin/admin.tpl	(revision 31060)
+++ /extensions/greydragon/admin/admin.tpl	(revision 31061)
@@ -15,5 +15,5 @@
       <li><a href="http://piwigo.org/forum/viewtopic.php?pid=154192" target="_blank">{'Support'|@translate}</a>&nbsp;|&nbsp;</li>
       <li><a title="Follow me on Twitter" href="http://twitter.com/greydragon_th" target="_blank">{'Follow'|@translate}</a>&nbsp;|&nbsp;</li>
-      <li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=9MWBSVJMWMJEU" target="_blank">{'Coffee Fund'|@translate}</a>&nbsp;|&nbsp;</li>
+      <li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GYVNZCNDMSD58" target="_blank">{'Coffee Fund'|@translate}</a>&nbsp;|&nbsp;</li>
       <li><a href="http://piwigo.org/ext/extension_view.php?eid=775" onclick="return false" target="_blank">{'Download'|@translate}</a></li>
     </ul>
@@ -102,5 +102,5 @@
       </li>
       <li><label><span class="graphicalCheckbox {if $options.p_animated_menu=="on"}icon-check{else}icon-check-empty{/if}">&nbsp;</span><input name="p_animated_menu" id="p_animated_menu" type="checkbox" value="on" {if $options.p_animated_menu=="on"}checked="checked"{/if}>{'Animate Menu'|@translate}</label></li>
-      <li><label><span class="graphicalCheckbox {if $options.p_main_menu_close=="on"}icon-check{else}icon-check-empty{/if}">&nbsp;</span><input name="p_main_menu_close" id="p_main_menu_close" type="checkbox" value="on" {if $options.p_main_menu_close=="on"}checked="checked"{/if}>{'Auto Close Popup Menu on Refresh'|@translate}</label></li>
+      <li><label><span class="graphicalCheckbox {if $options.p_main_menu_close=="on"}icon-check{else}icon-check-empty{/if}">&nbsp;</span><input name="p_main_menu_close" id="p_main_menu_close" type="checkbox" value="on" {if $options.p_main_menu_close=="on"}checked="checked"{/if}>{'Auto Close Popup Menu'|@translate}</label></li>
       <li>
         <select id="p_credits" name="p_credits">
Index: /extensions/greydragon/changelog.txt
===================================================================
--- /extensions/greydragon/changelog.txt	(revision 31060)
+++ /extensions/greydragon/changelog.txt	(revision 31061)
@@ -18,4 +18,11 @@
 
 === Changelog ===
+version 1.2.23
++ Added Icon tooltips in Icon metadata tab mode. This would also cause title to be shown in metadata overlay window
++ Added navigation arrows display when hover over photo. This is visual indicators to help with visualization of navigation. Use of image maps is still permitted
++ "Auto Close Popup Menu on Refresh" is now "Auto Close Popup Menu" - menu would close as soon as mouse leaves the popup menu area
++ Corrected PayPal link for "Donate" link in admin area
+- Further fixes for Picture Overlay mode - Tags' "edit" was missing for some browsers
+
 version 1.2.22 *
 + Added Photo metadata tab targets in picture.tpl (see template for positioning): {*GD_META_ICO*}, {*GD_META_TXT*}, {*GD_META_CONTENT*}
Index: /extensions/greydragon/css/styles.css
===================================================================
--- /extensions/greydragon/css/styles.css	(revision 31060)
+++ /extensions/greydragon/css/styles.css	(revision 31061)
@@ -119,16 +119,4 @@
 body.static-menu .contentWithMenu .titrePage { margin-left: -194px; }
 body.static-menu #mbCategories { margin-bottom: 1em; }
-
-/*
-body.static-menu .contentWithMenu ul.thumbnails,
-body.static-menu .contentWithMenu ul.thumbnailCategories,
-body.static-menu .contentWithMenu #theImageAndInfos, 
-body.static-menu .contentWithMenu .notification,
-body.static-menu .contentWithMenu form.filter,
-body.static-menu .contentWithMenu .category_search_results { padding-left: 200px; margin-left: 0; }
-
-body.static-menu .contentWithMenu .titrePage { padding-left: 6px; }
-body.static-menu .contentWithMenu .calendarCalBar { margin-left: 210px; }
-*/
 
 /* Static header bottom */
@@ -211,4 +199,21 @@
 
 #theImageAndInfos { display: block; width: 100%; position: relative; min-height: 30em; overflow: hidden; }
+
+#theImageAndInfos .gd-nav { display: block; width: 60px; height: 50px; margin: 0 0 0; position: absolute; z-index: 100; overflow: hidden; opacity: 0; cursor: pointer; color: #fff; -webkit-transition: all .3s ease; -moz-transition: all .3s ease; transition: all .3s ease; text-align: center; line-height: 48px; }
+#theImageAndInfos .gd-nav.nav-prev { left: 50%; margin-top: -30px; }
+#theImageAndInfos .gd-nav.nav-next { right: 50%; margin-top: -30px; }
+#theImageAndInfos .gd-nav.nav-up   { left: 50%; margin-left: -30px; top: 15px; }
+#theImageAndInfos .gd-nav.nav-zoom { left: 50%; margin-left: -30px; margin-top: -30px; }
+#theImageAndInfos:hover .nav-prev,
+#theImageAndInfos:hover .nav-next,
+#theImageAndInfos:hover .nav-up,
+#theImageAndInfos:hover .nav-zoom  { opacity: 1; }
+
+#theImageAndInfos a.gd-nav:before  { font-family: "Glyphicons Halflings"; font-size: 24px; display: inline-block; letter-spacing: 2px; letter-spacing: 0px; }
+#theImageAndInfos a.nav-prev:before { content: "\e079"; }
+#theImageAndInfos a.nav-next:before { content: "\e080"; }
+#theImageAndInfos a.nav-up:before   { content: "\e113"; }
+#theImageAndInfos a.nav-zoom:before { content: "\e003"; }
+
 #theImage { display: block; width: 100%; vertical-align: top; padding: 10px 0 5px 0; }
 #theImage img { padding: 2px; }
@@ -249,4 +254,5 @@
 
 #cboxContent { margin-top: 22px; }
+#cboxTitle   { padding-top: 0.3em; padding-left: 0.6em; }
 #cboxLoadedContent .image-metadata-tab { display: block; }
 
@@ -327,5 +333,5 @@
 #tab-cart input[type="submit"] { margin-right: 1em; }
 
-#cboxLoadedContent>div { padding: 8px 10px 20px 10px; }
+#cboxLoadedContent>div { padding: 8px 10px 10px 10px; }
 #cboxClose { right: 5px; }
 
@@ -333,4 +339,4 @@
 #tab-tags #TagsTable { width: 100%; min-width: 400px; z-index: 1; }
 // #Tags { background: none; }
-#Tags td.value { position: relative; vertical-align: top; }
+#Tags td.value { position: relative; vertical-align: top; min-height: 1.4em; display: block; }
 #Tags div.tags-edit-marker { position: absolute; right: 0; bottom: 0; }
Index: /extensions/greydragon/include/greydragon.class.php
===================================================================
--- /extensions/greydragon/include/greydragon.class.php	(revision 31060)
+++ /extensions/greydragon/include/greydragon.class.php	(revision 31061)
@@ -3,5 +3,5 @@
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
-define('GDTHEME_VERSION', '1.2.22');
+define('GDTHEME_VERSION', '1.2.23');
 
 define("QUOTES_NONE",   FALSE);
@@ -327,8 +327,4 @@
 </div>';
 
-    // <div class="gdHomeLinks">
-    //   <a href="index.php?/categories">Gallery</a>&nbsp;&#9679;&nbsp;<a href="index.php?/contact">Contact</a>
-    //  </div>
-
     $query = 'UPDATE ' . $prefix . 'additionalpages '
            . 'SET content = "' . pwg_db_real_escape_string($content) . '" '
@@ -429,4 +425,49 @@
   }
 
+  public function getPageTabs() {
+    // metadata array
+    // each tab represented by respected sub array
+    // sub array need to include 
+    //   "id"         = unique id of the tab
+    //   "icon_class" = class to be used to render icon tabs
+    //   "title"      = tab or menu block title
+    //   "content"    = block content
+    //   "target"     = optional, rendering target - "left", "top", "right", "bottom", not supported, reserved for future use
+    //   "combine"    = combine_css or combine_js reference block
+    //
+    // prior to rendering, each element would be processed and converted into tab content in picture.tpl
+
+    $metadata = array();
+    $metadata = trigger_change('gd_get_metadata', $metadata);
+
+    $meta_icon = "";
+    $meta_text = "";
+    $meta_content = "";
+
+    foreach ($metadata as $item):
+
+      $id            = $item["id"];
+      $icon_class    = $item["icon_class"];
+      $title         = $item["title"];
+      $block_content = $item["content"];
+      $combine       = $item["combine"];
+      $no_overlay    = $item["no_overlay"];
+
+      if ($no_overlay):
+        $meta_icon .= '<li class="ico-btn btn-' . $id . '">' . $block_content . '</li>';
+      else:
+        $meta_icon .= '<li class="meta-' . $id . '{if $ico_mode=="on"} ' . $icon_class . '{/if}{if $def_tab == "' . $id . '"} active{/if}"{if $ico_mode=="on"} title="{"' . $title . '"|@translate}"{/if}>{if $ico_mode=="off"}' . $title . '{/if}</li>';
+      endif;
+
+      $meta_text .= '<li class="{if $ico_mode=="on"}' . $icon_class . '{/if}{if $def_tab == "' . $id . '"} active{/if}" rel="tab-' . $id . '"{if $ico_mode=="on"} title="{"' . $title . '"|@translate}"{/if}>{if $ico_mode=="off"}' . $title . '{/if}</li>';
+      if (isset($combine)):
+        $meta_content .= '{strip}' . $combine . '{strip}';
+      else:
+        $meta_content .= '<div id="tab-' . $id . '" class="image-metadata-tab">' . $block_content . '</div>';
+      endif;
+    endforeach;
+
+    return array("icon" => $meta_icon, "text" => $meta_text, "content" => $meta_content);
+  }
 }
 
Index: /extensions/greydragon/js/theme.menu.js
===================================================================
--- /extensions/greydragon/js/theme.menu.js	(revision 31060)
+++ /extensions/greydragon/js/theme.menu.js	(revision 31061)
@@ -39,4 +39,10 @@
 
     if (p_hideabout) { jQuery('a[href$="about.php"]').parent().remove(); }
+
+    if (p_main_menu == "force_hide") {
+      $("#menubar").on('mouseleave', function(e) {
+        $(this).hide();
+      });
+    }
 
     if (p_main_menu == 'static') { 
@@ -83,4 +89,5 @@
       menuswitcher.hide();
     }
+
   });
 }());
Index: /extensions/greydragon/template/header.tpl
===================================================================
--- /extensions/greydragon/template/header.tpl	(revision 31060)
+++ /extensions/greydragon/template/header.tpl	(revision 31061)
@@ -73,5 +73,5 @@
 {if $includeMenu=="on"} 
   {combine_script id='greydragon.scripts' load='footer' require='jquery' path='themes/greydragon/js/theme.menu.js' order=100}
-  {if $greydragon.p_main_menu_close == "on"}
+  {if ($greydragon.p_main_menu_close == "on") && (($greydragon.p_main_menu == "opened") || ($greydragon.p_main_menu == "closed"))}
   var p_main_menu = "force_hide";
   {elseif isset({$greydragon.p_main_menu})}
Index: /extensions/greydragon/template/picture_tab_ico.tpl
===================================================================
--- /extensions/greydragon/template/picture_tab_ico.tpl	(revision 31060)
+++ /extensions/greydragon/template/picture_tab_ico.tpl	(revision 31061)
@@ -1,6 +1,6 @@
-    {if isset( $COMMENT_IMG )}<li class="meta-desc{if $ico_mode=="on"} glyphicon glyphicon-eye-open{/if}{if $def_tab == "desc"} active{/if}">{if $ico_mode=="off"}{"Description"|@translate}{/if}</li>{/if}
-    <li class="meta-info {if $ico_mode=="on"} glyphicon glyphicon-info-sign{/if}{if $def_tab == "info"} active{/if}">{if $ico_mode=="off"}{"Info"|@translate}{/if}</li>
-    {if isset($metadata)}<li class="meta-exif{if $ico_mode=="on"} glyphicon glyphicon-camera{/if}{if $def_tab == "exif"} active{/if}">{if $ico_mode=="off"}{"Exif"|@translate}{/if}</li>{/if}
-    {if ($display_info.tags && (isset($related_tags) || ($greydragon.hasUserTags)))}<li class="meta-tags{if $ico_mode=="on"} glyphicon glyphicon-tags{/if}{if $def_tab == "tags"} active{/if}" >{if $ico_mode=="off"}{"Tags"|@translate}{/if}</li>{/if}
-    {if isset($COMMENT_COUNT)}<li class="meta-comment{if $ico_mode=="on"} glyphicon glyphicon-comment{/if}{if $def_tab == "comments"} active{/if}">{if $ico_mode=="off"}{$COMMENT_COUNT|@translate_dec:'%d comment':'%d comments'}{else}&nbsp;{$COMMENT_COUNT}{/if}</li>{/if}
-    {if isset($ppppp_e_mail)}<li class="meta-cart{if $ico_mode=="on"} glyphicon glyphicon-shopping-cart{/if}{if $def_tab == "cart"} active{/if}" >{if $ico_mode=="off"}{"Cart"|@translate}{/if}</li>{/if}
+  {if isset( $COMMENT_IMG )}<li class="meta-desc{if $ico_mode=="on"} glyphicon glyphicon-eye-open{/if}{if $def_tab == "desc"} active{/if}"{if $ico_mode=="on"} title="{"Description"|@translate}"{/if}>{if $ico_mode=="off"}{"Description"|@translate}{/if}</li>{/if}
+  <li class="meta-info {if $ico_mode=="on"} glyphicon glyphicon-info-sign{/if}{if $def_tab == "info"} active{/if}"{if $ico_mode=="on"} title="{"Info"|@translate}"{/if}>{if $ico_mode=="off"}{"Info"|@translate}{/if}</li>
+  {if isset($metadata)}<li class="meta-exif{if $ico_mode=="on"} glyphicon glyphicon-camera{/if}{if $def_tab == "exif"} active{/if}"{if $ico_mode=="on"} title="{"Exif"|@translate}"{/if}>{if $ico_mode=="off"}{"Exif"|@translate}{/if}</li>{/if}
+  {if ($display_info.tags && (isset($related_tags) || ($greydragon.hasUserTags)))}<li class="meta-tags{if $ico_mode=="on"} glyphicon glyphicon-tags{/if}{if $def_tab == "tags"} active{/if}"{if $ico_mode=="on"} title="{"Tags"|@translate}"{/if}>{if $ico_mode=="off"}{"Tags"|@translate}{/if}</li>{/if}
+  {if isset($COMMENT_COUNT)}<li class="meta-comment{if $ico_mode=="on"} glyphicon glyphicon-comment{/if}{if $def_tab == "comments"} active{/if}"{if $ico_mode=="on"} title="{"Comments"|@translate}"{/if}>{if $ico_mode=="off"}{$COMMENT_COUNT|@translate_dec:'%d comment':'%d comments'}{else}&nbsp;{$COMMENT_COUNT}{/if}</li>{/if}
+  {if isset($ppppp_e_mail)}<li class="meta-cart{if $ico_mode=="on"} glyphicon glyphicon-shopping-cart{/if}{if $def_tab == "cart"} active{/if}"{if $ico_mode=="on"} title="{"Cart"|@translate}"{/if}>{if $ico_mode=="off"}{"Cart"|@translate}{/if}</li>{/if}
Index: /extensions/greydragon/template/picture_tab_txt.tpl
===================================================================
--- /extensions/greydragon/template/picture_tab_txt.tpl	(revision 31060)
+++ /extensions/greydragon/template/picture_tab_txt.tpl	(revision 31061)
@@ -1,6 +1,6 @@
-    {if isset( $COMMENT_IMG )}<li class="{if $ico_mode=="on"}glyphicon glyphicon-eye-open{/if}{if $def_tab == "desc"} active{/if}" rel="tab-desc">{if $ico_mode=="off"}{"Description"|@translate}{/if}</li>{/if}
-    <li class="{if $ico_mode=="on"}glyphicon glyphicon-info-sign{/if}{if $def_tab == "info"} active{/if}" rel="tab-meta">{if $ico_mode=="off"}{"Info"|@translate}{/if}</li>
-    {if isset($metadata)}<li class="{if $ico_mode=="on"}glyphicon glyphicon-camera{/if}{if $def_tab == "exif"} active{/if}" rel="tab-exif">{if $ico_mode=="off"}{"Exif"|@translate}{/if}</li>{/if}
-    {if ($display_info.tags && (isset($related_tags) || ($greydragon.hasUserTags)))}<li class="{if $ico_mode=="on"}glyphicon glyphicon-tags{/if}{if $def_tab == "tags"} active{/if}" rel="tab-tags">{if $ico_mode=="off"}{"Tags"|@translate}{/if}</li>{/if}
-    {if isset($COMMENT_COUNT)}<li class="{if $ico_mode=="on"}glyphicon glyphicon-comment{/if}{if $def_tab == "comments"} active{/if}" rel="tab-comment">{if $ico_mode=="off"}{$COMMENT_COUNT|@translate_dec:'%d comment':'%d comments'}{else}&nbsp;{$COMMENT_COUNT}{/if}</li>{/if}
-    {if isset($ppppp_e_mail)}<li class="{if $ico_mode=="on"}glyphicon glyphicon-shopping-cart{/if}{if $def_tab == "cart"} active{/if}" rel="tab-cart">{if $ico_mode=="off"}{"Cart"|@translate}{/if}</li>{/if}
+  {if isset( $COMMENT_IMG )}<li class="{if $ico_mode=="on"}glyphicon glyphicon-eye-open{/if}{if $def_tab == "desc"} active{/if}" rel="tab-desc"{if $ico_mode=="on"} title="{"Description"|@translate}"{/if}>{if $ico_mode=="off"}{"Description"|@translate}{/if}</li>{/if}
+  <li class="{if $ico_mode=="on"}glyphicon glyphicon-info-sign{/if}{if $def_tab == "info"} active{/if}" rel="tab-meta"{if $ico_mode=="on"} title="{"Info"|@translate}"{/if}>{if $ico_mode=="off"}{"Info"|@translate}{/if}</li>
+  {if isset($metadata)}<li class="{if $ico_mode=="on"}glyphicon glyphicon-camera{/if}{if $def_tab == "exif"} active{/if}" rel="tab-exif"{if $ico_mode=="on"} title="{"Exif"|@translate}"{/if}>{if $ico_mode=="off"}{"Exif"|@translate}{/if}</li>{/if}
+  {if ($display_info.tags && (isset($related_tags) || ($greydragon.hasUserTags)))}<li class="{if $ico_mode=="on"}glyphicon glyphicon-tags{/if}{if $def_tab == "tags"} active{/if}" rel="tab-tags"{if $ico_mode=="on"} title="{"Tags"|@translate}"{/if}>{if $ico_mode=="off"}{"Tags"|@translate}{/if}</li>{/if}
+  {if isset($COMMENT_COUNT)}<li class="{if $ico_mode=="on"}glyphicon glyphicon-comment{/if}{if $def_tab == "comments"} active{/if}" rel="tab-comment"{if $ico_mode=="on"} title="{"Comments"|@translate}"{/if}>{if $ico_mode=="off"}{$COMMENT_COUNT|@translate_dec:'%d comment':'%d comments'}{else}&nbsp;{$COMMENT_COUNT}{/if}</li>{/if}
+  {if isset($ppppp_e_mail)}<li class="{if $ico_mode=="on"}glyphicon glyphicon-shopping-cart{/if}{if $def_tab == "cart"} active{/if}" rel="tab-cart"{if $ico_mode=="on"} title="{"Cart"|@translate}"{/if}>{if $ico_mode=="off"}{"Cart"|@translate}{/if}</li>{/if}
Index: /extensions/greydragon/themeconf.inc.php
===================================================================
--- /extensions/greydragon/themeconf.inc.php	(revision 31060)
+++ /extensions/greydragon/themeconf.inc.php	(revision 31061)
@@ -2,5 +2,5 @@
 /*
 Theme Name: GreyDragon
-Version: 1.2.22
+Version: 1.2.23
 Description: GreyDragon Theme
 Theme URI: http://piwigo.org/ext/extension_view.php?eid=775
@@ -48,8 +48,27 @@
   $template->assign('greydragon', $themeCore->getConfig());
 
+  $template->smarty->registerPlugin("modifier", "get_x_half", "greydragon_array_getXhalf");
+  $template->smarty->registerPlugin("modifier", "get_y_half", "greydragon_array_getYhalf");
+
   // Allow dynamic addition of metadata tabs content
   add_event_handler('loc_begin_picture', 'greydragon_picture_handler');
+}
 
+function greydragon_array_getXhalf($array) {
+  if (isset($array) && (count($array) > 0)):
+    return (int)($array[0] / 2);
+  else:
+    return "";
+  endif;
 }
+
+function greydragon_array_getYhalf($array) {
+  if (isset($array) && (count($array) > 1)):
+    return (int)($array[1] / 2);
+  else:
+    return 1000;
+  endif;
+}
+
 
 function greydragon_picture_handler() {
@@ -60,61 +79,45 @@
 
 function greydragon_prepare_meta($tpl_source, &$smarty) {
-  // metadata array
-  // each tab represented by respected sub array
-  // sub array need to include 
-  //   "id"         = unique id of the tab
-  //   "icon_class" = class to be used to render icon tabs
-  //   "title"      = tab or menu block title
-  //   "content"    = block content
-  //   "target"     = optional, rendering target - "left", "top", "right", "bottom", not supported, reserved for future use
-  //   "combine"    = combine_css or combine_js reference block
-  //
-  // prior to rendering, each element would be processed and converted into tab content in picture.tpl
 
-  $metadata = array();
-  $metadata = trigger_change('gd_get_metadata', $metadata);
-
-  $meta_icon = "";
-  $meta_text = "";
-  $meta_content = "";
-
-  foreach ($metadata as $item):
-
-    $id            = $item["id"];
-    $icon_class    = $item["icon_class"];
-    $title         = $item["title"];
-    $block_content = $item["content"];
-    $combine       = $item["combine"];
-    $no_overlay    = $item["no_overlay"];
-
-    if ($no_overlay):
-      $meta_icon .= '<li class="ico-btn btn-' . $id . '">' . $block_content . '</li>';
-    else:
-      $meta_icon .= '<li class="meta-' . $id . '{if $ico_mode=="on"} ' . $icon_class . '{/if}{if $def_tab == "' . $id . '"} active{/if}" >{if $ico_mode=="off"}' . $title . '{/if}</li>';
-    endif;
-
-    $meta_text .= '<li class="{if $ico_mode=="on"}' . $icon_class . '{/if}{if $def_tab == "' . $id . '"} active{/if}" rel="tab-' . $id . '">{if $ico_mode=="off"}' . $title . '{/if}</li>';
-    if (isset($combine)):
-      $meta_content .= '{strip}' . $combine . '{strip}';
-    endif;
-    $meta_content .= '<div id="tab-' . $id . '" class="image-metadata-tab">' . $block_content . '</div>';
-  endforeach;
+  $metadata = greyDragonCore::Instance()->getPageTabs();
 
   $content  = $tpl_source;
-  if ($meta_icon):
+  if ($metadata["icon"]):
     $pattern  = '#{\*GD_META_ICO\*}#';
-    $replace  = $meta_icon . "{*GD_META_ICO*}";
+    $replace  = $metadata["icon"] . "{*GD_META_ICO*}";
     $content  = preg_replace($pattern, $replace, $content, 1);
   endif;
-  if ($meta_text):
+  if ($metadata["text"]):
     $pattern  = '#{\*GD_META_TXT\*}#';
-    $replace  = $meta_text . "{*GD_META_TXT*}";
+    $replace  = $metadata["text"] . "{*GD_META_TXT*}";
     $content  = preg_replace($pattern, $replace, $content, 1);
   endif;
-  if ($meta_content):
+  if ($metadata["content"]):
     $pattern  = '#{\*GD_META_CONTENT\*}#';
-    $replace  = $meta_content . "{*GD_META_CONTENT*}";
+    $replace  = $metadata["content"] . "{*GD_META_CONTENT*}";
     $content  = preg_replace($pattern, $replace, $content, 1);
   endif;
+
+  $pattern  = '#<div.*"theImageAndInfos".*>#';
+  $replace  = '$0
+    {if isset($previous.U_IMG)}<a class="gd-nav nav-prev" title="{\'Previous\'|translate}" href="{$previous.U_IMG}">&nbsp;</a>{/if}
+    {if isset($next.U_IMG)    }<a class="gd-nav nav-next" title="{\'Next\'|translate}" href="{$next.U_IMG}">&nbsp;</a>{/if}
+    {if isset($U_UP)          }<a class="gd-nav nav-up"   title="{\'Up\'|translate}" href="{$U_UP}">&nbsp;</a>{/if}
+{*    <a class="gd-nav nav-zoom" title="{\'Full HD\'|translate}" href="{$U_UP}">&nbsp;</a> *}
+  {html_head} 
+    <style type="text/css">{strip}
+      {if $current.selected_derivative}
+      #theImageAndInfos .gd-nav.nav-prev {ldelim} margin-left: -{$current.selected_derivative->get_size()|get_x_half}px !important; top: {$current.selected_derivative->get_size()|get_y_half}px; {rdelim}
+      #theImageAndInfos .gd-nav.nav-next {ldelim} margin-right: -{$current.selected_derivative->get_size()|get_x_half}px !important; top: {$current.selected_derivative->get_size()|get_y_half}px; {rdelim}
+      {else}
+      #theImageAndInfos .gd-nav.nav-prev {ldelim} margin-left: -30% !important; top: 50%; {rdelim}
+      #theImageAndInfos .gd-nav.nav-next {ldelim} margin-right: -30% !important; top: 50%; {rdelim}
+      {/if}
+{*      #theImageAndInfos .gd-nav.nav-zoom {ldelim} top: {$current.selected_derivative->get_size()|get_y_half}px; {rdelim} *}
+    {/strip}</style>
+  {/html_head}';
+
+  $content  = preg_replace($pattern, $replace, $content, 1);
+
   return $content;
 }
