Optimized creation of thumbnails. Aspect ratio should be preserved now.