patch to support changed libpng > 1.5 interface