Convert input images if needed.