improved performance loading gallery