Add some logging when thumbnailing fails
It fails, but only on Travis
Do not close image files too early when generating thumbnails...