Allow manually specifying image type to avoid Tempfile issues