use more modern libpng version instead of the system-provided one and fix compile errors