you don't have to keep echo '<a name="top_display_media"></a>'; in those theme sections.
You can comment it out //echo '<a name="top_display_media"></a>'; and just put
<a name="top_display_media"></a> in your template.html so that it is above all the menus.
For the slideshow:
/******************************************************************************
** Section <<<theme_slideshow>>> - START
******************************************************************************/
function theme_slideshow($start_img,$title)
{
global $CONFIG, $lang_display_image_php, $template_display_media, $lang_common, $album, $pid, $slideshow;
global $cat, $date, $THEME_DIR;
pageheader($lang_display_image_php['slideshow']);
template_extract_block($template_display_media, 'img_desc', $start_slideshow);
/** set styles to slideshow background */
$setDimentionW= $CONFIG['picture_width'] + 100;
$setDimentionH= $CONFIG['picture_width'] + 10;
if (defined('THEME_HAS_PROGRESS_GRAPHICS')) {
$prefix = $THEME_DIR;
} else {
$prefix = '';
}
$params = array(
'{SLIDESHOW_STYLE}' => 'width:' .$setDimentionW. 'px; height: '.$setDimentionH.'px; position: relative;' ,
'{IMAGE}' => '<img id="showImage" src="' . $start_img . '" class="image" alt="" border="" /><br />',
'{ADMIN_MENU}' => '',
'{LOADER_ICON_PATH}' => $prefix . 'images/loader.gif',
);
echo '<a name="top_display_media"></a>';
starttable();
echo <<<EOT
<tr class="noscript">
<td align="center" class="tableh2">
<noscript>
{$lang_common['javascript_needed']}
</noscript>
</td>
</tr>
<tr>
<td align="center" class="navmenu" style="white-space: nowrap;">
<div id="title">{$title}</div>
</td>
</tr>
EOT;
endtable();
starttable();
echo template_eval($template_display_media, $params);
endtable();
starttable();
echo <<<EOT
<tr>
<td align="center" id="back-to" class="navmenu" >
<a class="navmenu" style="cursor:pointer">{$lang_display_image_php['stop_slideshow']}</a>
</td>
</tr>
EOT;
endtable();
pagefooter();
}
/******************************************************************************
** Section <<<theme_slideshow>>> - END
******************************************************************************/