How to add image field in a custom module form?
The default_value attribute accept an array in case of managed_file:

  $form['my_file'] = [
      '#type' =&gt; 'managed_file',
      '#title' =&gt; 'my file',
      '#name' =&gt; 'my_custom_file',
      '#description' =&gt; $this-&gt;t('my file description'),
      '#default_value' =&gt; [$config-&gt;get('my_file')],
      '#upload_location' =&gt; 'public://'
    ];


In The submit function you are using a field name different from the declared one in the buildForm().

The value of a managed_file should be an array even when the field is not multiple:

$form_state-&gt;getValue('default_press_release_image')[0];