update gallery.php