gallery loading fix