Detects best image format for images