fixed gallery init