add galleryId to pages table