Your comments

I have Gentoo too: there is an easy fix!

Gentoo provides slots for having multiple versions of a package installed at once. I assume the libpng you have at the moment is version 1.5.x - an up-to-date version. To get the old one (1.2.x), type

sudo emerge libpng:1.2

This will install the older version, which provides, side-by-side to the newer version.