optimized gallery calls with lazy load sql and array of items