Use old libpng API since libpng 1.6 is still rare to have installed.