8 – How to prevent image/file deletion from a configForm if don’t press on submit button?

I created a custom config Form in drupal 8, and this form have a managed_file field for upload a logo, the problem is that i set all fields, upload my image and fill other fields, press save, and in this point everything works normal. But if i press on “Delete” button of the image, my file is automatically deleted from my file directory and i have not saved the changes to my form yet.

so in my config still saved a fid of my deleted file. But the file was deleted before save my config form so if i update the page without save not matters, my file was deleted.

Any ideas for control this event to prevent this deletion if i don’t save the configuration Form?

my_module/src/Form/CustomForm.php

<?php

namespace Drupalmy_moduleForm;

use DrupalCoreFormConfigFormBase;
use DrupalCoreFormFormStateInterface;
use DrupalfileEntityFile;

/**
 * Class CustomizationForm.
 */
class CustomForm extends ConfigFormBase {

  /**
   * {@inheritdoc}
   */
  protected function getEditableConfigNames() {
    return (
      'my_module.custom',
    );
  }

  /**
   * {@inheritdoc}
   */
  public function getFormId() {
    return 'custom_form';
  }

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    $config = $this->config('my_module.custom');

    $form('menu_logo') = (
      '#type' => 'managed_file',
      '#title' => $this->t('Menu logo'),
      '#upload_validators' => (
        'file_validate_extensions' => ('png jpg jpeg'),
        'file_validate_size' => (25600000),
      ),
      '#theme' => 'image_widget',
      '#preview_image_style' => 'medium',
      '#upload_location' => 'public://',
      '#default_value' => $config->get('menu_logo'),
      '#required' => TRUE,
    );
    $form('splash_screen') = (
      '#type' => 'managed_file',
      '#title' => $this->t('Splash screen'),
      '#upload_validators' => (
        'file_validate_extensions' => ('png jpg jpeg'),
        'file_validate_size' => (25600000),
      ),
      '#theme' => 'image_widget',
      '#preview_image_style' => 'medium',
      '#upload_location' => 'public://',
      '#default_value' => $config->get('splash_screen'),
    );
    $form('theme') = (
      '#type' => 'select',
      '#title' => $this->t('Theme'),
      '#title_display' => 'invisible',
      '#options' => ('dark' => $this->t('Dark theme'), 'light' => $this->t('Light theme')),
      '#default_value' => $config->get('theme'),
    );

    $form('#attached')('library') = (
      'my_module/customization_form',
    );

    $buildForm = parent::buildForm($form, $form_state);
    $buildForm('#theme') = 'customization_form';

    return $buildForm;

  }

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    parent::submitForm($form, $form_state);

    $this->config('my_module.custom')
      ->set('menu_logo', $form_state->getValue('menu_logo'))
      ->set('splash_screen', $form_state->getValue('splash_screen'))
      ->set('theme', $form_state->getValue('theme'))
      ->save();

    if (!empty($images)) {
      foreach ($images as $image) {
        $file = File::load($image(0));
        $file_usage = Drupal::service('file.usage');
        $file->setPermanent();
        $file->save();

        $file_usage->add($file, 'my_module', 'file', $file->id());
      }
    }

  }

}