Fix lowercase to uppercase typo
Fix #17. Bug in writing color png images. Fix and unit test added