Image resizing enhancements.

- Don't save medium/thumbnails where the larger format is small enough.
- Don't upsize video thumbnails either.