libpng related fixes