Resize thumbnails in two steps to increase performance