Some fixes in gallery