add new feature and config param "saveCurrentImageIfFailure"