Passing Image through hook Background:
Im working in Drupal 8 and I have a paragraph type that contains a title and an image and I am trying to pass it through the preprocessor hook so I can set it inside a html template. For testing purposes all I have on my template is div that calls the image variable. Im more worried about the pre_processor than I am the html
Code:
function theme_preprocess_node(&amp;$variables) {
  if ($variables['node']-&gt;getType() == 'landing_page') {
    $paragraphs = $variables['node']-&gt;field_section-&gt;getValue();
    $section = [];
    foreach ($paragraphs as $key =&gt; $paragraph) {
      $p = Paragraph::load($paragraph['target_id']);

      echo &quot;&lt;pre&gt;&quot;.print_r($p,TRUE).&quot;&lt;/pre&gt;&quot;;

      switch ($p-&gt;getType()) {
        case 'tabbed_body':
          foreach ($p-&gt;field_body_tab_content-&gt;getValue() as $tab) {
            $t = Paragraph::load($tab['target_id']);
            $title = $t-&gt;field_body_tab_title-&gt;getValue();
            $content = $t-&gt;field_tab_content-&gt;getValue();
            $image = $t-&gt;field_body_image-&gt;getValue();
            $section[$key]['tabbed_body'][] = [
              'title' =&gt; $title[0]['value'],
              'content' =&gt; $content[0]['value'],
              'image' =&gt; $image[0],
            ];
          }
          break;    
      }
    }
    $variables['sections'] = $section;
   }
}

Image Settings:
You can pass only the image uri, and render image using it in the twig.
Try the following suggestion:
In your loop try to get image as the following:  

  $image_field_values= $t-&gt;field_body_image-&gt;getValue();
  /**
   * @TODO: if you have multiple values loop through them i will test just by the first
   */
  $image_target_id = $image_field_values[0]['target_id'];
  $image_file = File::load($image_target_id);
  $section[$key]= [
    'image_uri' =&gt; $image_file-&gt;getFileUri()
  ];


In your twig will be something like:


&lt;img src="{{ file_url(section[0]['image_uri'])}}" &gt;


Don't forget use Drupal\file\Entity\File;.