rewrite gallery.php