add checks for libpng