I have been working with a client with close to 600k images on their home page. The photos are tagged with multiple categories. The index API returns paginated pictures based on various sets of filters on classes. Recently, they normalized their data, and every image was mapped to 4 different categories through join tables.