The "Remove" button is not working
function name_module_form() {
  $form['logo'] = array(
    '#type' =&gt; 'managed_file',
    '#title' =&gt; 'Logo',
    '#default_value' =&gt; variable_get('logo', ''),
    '#description' =&gt; t('Upload File'),
    '#upload_validators' =&gt; array(
      'file_validate_extensions' =&gt; array('gif png jpg jpeg'),
      'file_validate_size' =&gt; array(100 * 1024 * 1024),
    ),
    '#theme' =&gt; 'abc_thumb_upload',
    '#upload_location' =&gt; 'public://abc/',
    '#attributes' =&gt; array(
    'multiple' =&gt; 'multiple'
  ));
}

function name_module_theme() {
  return array(
    'abc_thumb_upload' =&gt; array(
    'render element' =&gt; 'element',
    'file' =&gt; 'name_module.module',
  ));
}

function theme_abc_thumb_upload($variables) {
  $element = $variables['element'];
  if (isset($element['#file']-&gt;uri)) {
    $output = '&lt;div id="edit-logo-ajax-wrapper"&gt;&lt;div class="form-item form-type-managed-file form-item-logo"&gt;&lt;span class="file"&gt;';
    $output .= '&lt;img height="100px" src="' . file_create_url($element['#file']-&gt;uri) . '" /&gt;';
    $output .= '&lt;/span&gt;&lt;input type="submit" id="edit-' . isset($element['remove_button']['#name ']) . '-remove-button" name="' . isset($element['remove_button']['#name ']) . '_remove_button" value="Remove" class="btn btn-default form-submit ajax-processed"&gt;';
    $output .= '&lt;input type="hidden" name="' . isset($element['remove_button']['#name ']) . '[fid]" value="' . $element['#file']-&gt;fid . '"&gt;';

    return $output;
  }
}