Fix problems with libpng