Enable resizing image thumbs

Only works for jpeg.  Other formats should probably be thought of along
with previews, but this is good enough for all current use cases.
Fixes #1039