[Bug #1057266] Resize thumbnails in the Open Image dialog if necessary.

This makes the dialog more robust when using file format addins, and
also makes it easier to develop file format addins in cases where the
format doesn't provide an easy way to load a scaled version of the
image.