For the Wikibase repo, the URL of Wikimedia Commons is hardcoded into extensions/ValueView/lib/jquery.ui/jquery.ui.commonssuggester.js and lib/includes/formatters/CommonsLinkFormatter.php, as well as in repo/includes/CachingCommonsMediaFileNameLookup.php.
A new setting $wgWBRepoSettings['commonsSiteId'] shall contain the id for the desired wiki providing the files. If this is not set, the default will be pointing to Wikimedia Commons.