Issue #3474899: Avoid a deprecation when passing null to the function image_type_to_extension when the type is not set (e.g. svg files).
Closes #3474899