How do I specify an image style in my preprocess function?
Have you tried render

// Implements hook_preprocess_node();
    function mycustomtheme_preprocess_node(&amp;$vars) {

      $node = $vars['node'];
      $field_name = 'field_main_image';
      if (
        isset($node-&gt;$field_name) &amp;&amp;
        empty($node-&gt;$field_name)
      ) {
        $node_wrapper = entity_metadata_wrapper('node', $node);
        if ($node_wrapper-&gt;field_master_reference-&gt;raw()) {
          $project = $node_wrapper-&gt;field_master_reference-&gt;value();
          $vars['content'][$field_name] = render($vars['content'][$field_name]);
        }
      }
    }