It happens slightly in Safari on Windows (OK if you refresh the page), but OK in IE8 and Firefox.
To get rid of the problem altogether, (and to make it also display correctly in Dreamweaver's 'design view') you need to remove the line:
<!-- InstanceBegin template="/Templates/main-template.dwt" codeOutsideHTMLIsLocked="false" -->
From between the HEAD and BODY tags, and put it (where it should have been placed when you created the page from template) inside the HEAD tags - right after the <html> opening tag - i.e.:
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/gallery.dwt.php" codeOutsideHTMLIsLocked="false" -->
If it's just this one page, open it in NotePad (or other plain-text editor) and cut and paste the line to the right place.