fixed gallery loading issues