We had the issue that some content was not uploaded properly and we want to make sure to give back some kind of error to the user. This is why we wrap it.
Fix bug where content_type is not set. We need to check if an uploaded file's mime type is mapped to image. Later the code uses the passed in other_type or image_type parameter to set the actual content type of the item created. The code only checks for image or not image, so we don't need to find out every type mapped to the upload file's mime type.