Some background info might be useful. Why are the images being stored in a database? Do you need to be able to access images farther back than the 50-100 images needed for animation? Are those 50-100 images always going to be the most recent ones? What's the expected number of views? I'd personally store the images in folders by day using some naming system involving timestamps, thus making it unnecessary to use a database to access the images.