removed duplicated imwrite