Image getting delete away by the cronjob later in drupal 7 using theme settings
A quote from the docs:


  Note: New files are uploaded with a status of 0 and are treated as temporary files which are removed after 6 hours via cron. Your module is responsible for changing the $file objects status to FILE_STATUS_PERMANENT and saving the new status to the database. Something like the following within your submit handler should do the trick ...


You would need to put the example code that follows in the docs, into a function that you add as a submit handler:

$form['themeA_settings']['header-page']['header_background_file'] = array(
  '#type' =&gt; 'managed_file',
  ...
  '#submit' =&gt; array('your_custom_submit_handler'), // &lt;-- This line is new
);


The function itself could look like this then:

function your_custom_submit_handler($form, &amp;$form_state) {
  // Load the file via file.fid.
  $file = file_load($form_state['values']['my_file_field']);
  // Change status to permanent.
  $file-&gt;status = FILE_STATUS_PERMANENT;
  // Save.
  file_save($file);
  // Record that the module (in this example, user module) is using the file. 
  file_usage_add($file, 'user', 'user', $account-&gt;uid);  
}


You can of course reuse that function for all your files.