Lukas, it looks like that your fix indeed make it pass on RHEL7. Even if it was not able to find libpng-devel.