How to add an image(field) to a block? I want to add a block containing an image-(field) to Drupal, so it can be added to the block layout.
I can see the image gets uploaded (because it appears in my file system). But, the block 'forgets' about the image. Next time I configure the block, the image I just uploaded has disapeared.
The documentation is a bit fragmented, and I can't figure out how to:

set a default value for the image
how to create the render-array.

What I've got so far:
  /**
   * {@inheritdoc}
   */
  public function build(){
    $build = [];
    $build['image']['#markup'] = '';
    return $build;
  }

  /**
   * {@inheritdoc}
   */
  public function blockForm($form, FormStateInterface $form_state) {

    $form['image'] = array(
      '#type' =&gt; 'managed_file',
      '#upload_location' =&gt; 'public://images/',
      '#title' =&gt; $this-&gt;t('Image'),
      '#description' =&gt; t(&quot;Image to show on the contact form&quot;),
      '#default_value' =&gt; $this-&gt;configuration['image']['value'],
      '#upload_validators' =&gt; array(
        'file_validate_extensions' =&gt; array('gif png jpg jpeg'),
        'file_validate_size' =&gt; array(25600000),
      ),
      '#states'        =&gt; array(
        'visible'      =&gt; array(
          ':input[name=&quot;image_type&quot;]' =&gt; array('value' =&gt; t('Upload New Image(s)')),
        )
      )
    );

    return $form;
  }

  public function  blockValidate($form, FormStateInterface $form_state) {
//    File::load( $form_state-&gt;getValue('image'));
  }

  /**
   * {@inheritdoc}
   */
  public function blockSubmit($form, FormStateInterface $form_state) {

    /* Fetch the array of the file stored temporarily in database */
    $image = $form_state-&gt;getValue('image');

    $this-&gt;configuration['image'] = $image;

    /* Load the object of the file by it's fid */
    $file = \Drupal\file\Entity\File::load( $image[0] );

    /* Set the status flag permanent of the file object */
    $file-&gt;setPermanent();

    /* Save the file in database */
    $file-&gt;save();
  }
}

How do I display an user-uploaded image?
How do I make the block remember this picture?
With help from "Ambidex" on Drupal Slack, I post here the complete plugin-file. 

I could not find an example for this use case, and I believe it might benefit others:

file: [drupalroot]/modules/custom/ourcustomername_tweaks/src/Plugin/Block
/ContactBlock.php

.

&lt;?php


namespace Drupal\ourcustomername_tweaks\Plugin\Block;

use Drupal\Core\Block\BlockBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\file\Entity\File;



/**
 * Provides a 'Contact' Block.
 *
 * @Block(
 *   id = "contact_block",
 *   admin_label = @Translation("Image Contact block"),
 * )
 */
class ContactBlock extends BlockBase {

  /**
   * {@inheritdoc}
   */
  public function defaultConfiguration() {
    return [

        'image' =&gt; [
          'value' =&gt; ''
        ],

        'label_display' =&gt; FALSE,
      ] + parent::defaultConfiguration();
  }

  /**
   * {@inheritdoc}
   */
  public function build(){
    $build = [];


    if (  isset($this-&gt;configuration['image']) &amp;&amp; !empty( $this-&gt;configuration['image'] )  ) {

      $image_field = $this-&gt;configuration['image'];
      $image_uri = File::load($image_field[0]);

      $build['image'] = [
        '#theme' =&gt; 'image_style',
        '#style_name' =&gt; 'ourcustomername',
        '#uri' =&gt; $image_uri-&gt;uri-&gt;value
      ];
    } else {
      $build['image']['#markup'] = '['.t('Picture').']';
    }


    return $build;
  }

  /**
   * {@inheritdoc}
   */
  public function blockForm($form, FormStateInterface $form_state) {

    $form['image'] = array(
      '#type' =&gt; 'managed_file',
      '#upload_location' =&gt; 'public://images/',
      '#title' =&gt; $this-&gt;t('Image'),
      '#description' =&gt; t("Image to show on the contact form"),
      '#default_value' =&gt; $this-&gt;configuration['image'],
      '#upload_validators' =&gt; array(
        'file_validate_extensions' =&gt; array('gif png jpg jpeg'),
        'file_validate_size' =&gt; array(25600000),
      ),
      '#states'        =&gt; array(
        'visible'      =&gt; array(
          ':input[name="image_type"]' =&gt; array('value' =&gt; t('Upload New Image(s)')),
        )
      )
    );

    return $form;
  }


  /**
   * {@inheritdoc}
   */
  public function blockSubmit($form, FormStateInterface $form_state) {

    /* Fetch the array of the file stored temporarily in database */
    $image = $form_state-&gt;getValue('image');

    $this-&gt;configuration['image'] = $image;

    /* Load the object of the file by it's fid */
    $file = \Drupal\file\Entity\File::load( $image[0] );

    /* Set the status flag permanent of the file object */
    $file-&gt;setPermanent();

    /* Save the file in database */
    $file-&gt;save();
  }
}