Fixing write png