Improved image content-type handling