protected function initMediaResource(&$arg)
    {
        if (is_string($arg)) {
            $mr = new MediaResource();
            $mr->setUrl($arg);
        } else {
            $mr = $arg;
        }

        $mr->setHttpClient($this->httpClient);
        $mr->setStore($this->storage);
        return $mr;
    }