Uploaded images in theme settings is going to be lost
My solution is to ensure to make permanent the image when drupal load page theme settings. You don't need to create a custom submit handler because after the new settings are saved the settings page is reloaded, and the fix executed.

Plus, you cannot use "active theme" because sometimes the current active theme is the admin theme, and not the default or maybe the user is changing the settings theme in a theme that it's not set as default.

function YOUR_THEME_form_system_theme_settings_alter(&amp;$form, &amp;$form_state)  {

  $default_file_dir = 'public://template/logos';
  $folder = file_prepare_directory($default_file_dir, FILE_CREATE_DIRECTORY);
  $settings_theme = $form_state['build_info']['args'][0];

  if ($folder) {
    $my_logo = theme_get_setting('my_logo');
    // BUG: Force file to be permanent.
    if (!empty($my_logo)) {
      _fix_permanent_image('my_logo', $settings_theme);
    }
    $form['my_logo'] = array(
      '#type'               =&gt; 'managed_file',
      '#title'              =&gt; l('My logo'),
      '#default_value'      =&gt; $my_logo,
      '#progress_message'   =&gt; t('Please wait...'),
      '#progress_indicator' =&gt; 'bar',
      '#upload_location'    =&gt; $default_file_dir,
      '#upload_validators'  =&gt; array(
        'file_validate_extensions' =&gt; array('gif png jpg jpeg'),
        'file_validate_image_resolution' =&gt; array('375x50', '30x50'),
      ),
    );
  }

}

function _fix_permanent_image($image, $theme) {
  $fid = theme_get_setting($image, $theme);
  if ($fid &gt; 0) {
    $file = file_load($fid);
    if (is_object($file) &amp;&amp; $file-&gt;status == 0) {
      $file-&gt;status = FILE_STATUS_PERMANENT;
      file_save($file);
      file_usage_add($file, $theme, 'theme', 1);
      drupal_set_message($image . ' saved permanently.', 'status');
    }
  }
}