respect THUMBNAIL_PRESERVE_EXTENSIONS

Easy Thumbnails' THUMBNAIL_PRESERVE_EXTENSIONS option was being ignored.

This is basically the same implementation as it is in Easy Thumbnails and avoids odd behavior where setting this option doesn't seem to produce a desired behavior.

Ability to keep same format helps avoiding blemishes when resizing things like corporate logos.