fixed gallery creation in gallery model