Better identification of image content type, some error handling on archive