Fixed PNG save function