title: Drupal 8, add an image field from a BuildForm with preview
body: <p>I created a custom form from a buildForm function. In this form, I would like add an image field.</p>
  
  <p>I can do that via this code : </p>
  
  <pre><code>$form['main']['image'] = array(
      '#type' =&gt; 'text_format',
      '#title' =&gt; t('image'),
      '#default_value' =&gt; array(10),
  );
  </code></pre>
  
  <p>I can upload and remove the image from my form. However, when I upload an image, I haven't this preview.
  I mean, when I create a content via the Drupal UI. I can add a preconfigured "image" field. When I upload an image via this "image" field, I have a preview of the image.</p>
  
  <p>And here, when I create the field element programmatically, I haven't a preview of the image when I upload her.
  How use api Drupal for have the preview of the image when I upload her via my "image" field ?</p>