Fix using deprecated libpng API

See http://www.libpng.org/pub/png/src/libpng-1.2.x-to-1.4.x-summary.txt