Optimizations to compact and squarish thumbnails