better gallery, fixed bugs