build.sh: fix private registry detect method