temporary commit
Bug fix on avoiding invalid patch

and save result image
temp