Fix image convert error handling