Limit the maximum size of preview images.

Fixes #3