fix bugs and add GalleryServlet