modules/media/components/MediaRender.php
public function render($imgSrc, $data = [])
    {
        $media = new Media();
        $media->mimeType = 'image/jpeg';
        $media->filename = basename($imgSrc);
        if (strpos($imgSrc,'files') !== false) {
            $media->source =  ltrim($imgSrc);
        } else {
            $media->source =  'frontend/web' . $imgSrc;
        }

        return $media->render($data);
    }
public function render($imgSrc, $data = [])
    {
        $media = new Media();
        $media->mimeType = 'image/jpeg';
        $media->filename = basename($imgSrc);
        if (strpos($imgSrc,'files') !== false) {
            $media->source =  ltrim($imgSrc);
        } else {
            $media->source =  'frontend/web' . $imgSrc;
        }

        return $media->render($data);
    }
Render remote images
Usage: echo Yii::$app->media->render('HTTP://URL_TO_IMAGE_HERE.JPG')
@param $imgSrc
@param array $data
@return bool|string