Better generating thumbnails when missing images

Fixes #52