updated writeimage script and README.md