integrate galleries with rooms and refactor integration architecture within single file