I briefly entertained the idea of mixing thumbnails and original data in the same directory structure, but the truth is that thumbnails have very different needs and applications and, by their very nature, they are disposable data, so they should be handled separately.
- Resizing images automatically with nginx: https://gist.github.com/phpdude/1451684
- Keep image metadata in a table and the images themselves in the file system in a trie format. Set the mime-type and image name in the header so they can be properly downloaded: http://programmers.stackexchange.com/a/164933
- Advice about server structure based on the number of images, number of hits, etc: http://programmers.stackexchange.com/questions/278693/most-efficient-way-of-saving-images-and-sending-them-to-client-browser
- Anticipatory resizing versus resizing on the fly: http://programmers.stackexchange.com/a/86627