Render media entity image
You need to build a render array
$build = \Drupal::entityTypeManager()-&gt;getViewBuilder('media')-&gt;view(‌$media, $view_mode);

and then place it unrendered in a template, Twig renders this automatically.