minor update imagepng function