Fixed creation of corrupt PNG files due to data being absent