[FIX] keep image type intact during resize

Unless specficially requested, the output image should have the same file type
as the input (JPEG -> JPEG, PNG -> PNG), everything should not be converted to
PNG by default.