diff --git a/js/media.browser.js b/js/media.browser.js
index e7a9934..e3891b6 100644
--- a/js/media.browser.js
+++ b/js/media.browser.js
@@ -27,6 +27,7 @@ Drupal.behaviors.experimentalMediaBrowser = {
 
     $('.media-browser-tab').each( Drupal.media.browser.validateButtons );
 
+    Drupal.media.browser.selectActiveTab();
     Drupal.media.browser.selectErrorTab();
 
   }
@@ -117,4 +118,20 @@ Drupal.media.browser.selectErrorTab = function() {
   }
 }
 
+Drupal.media.browser.selectActiveTab = function() {
+ // Find the ID of a tab with an error in it
+ var activeTabID = $('#media-browser-tabset')
+   .find('input[name*="media-selected-tab"]')
+   .parents('.media-browser-tab')
+   .attr('id');
+  if (activeTabID !== undefined) {
+    // Find the Tab Link with errorTabID
+    var tab = $('a[href="#' + activeTabID + '"]');
+    // Find the index of the tab
+    var index = $('#media-browser-tabset a').index(tab);
+    // Select the tab
+    $('#media-browser-tabset').tabs('select', index);
+  }
+};
+
 }(jQuery));
diff --git a/media.module b/media.module
index 6e28da0..58daac8 100644
--- a/media.module
+++ b/media.module
@@ -513,6 +513,13 @@ function media_form_alter(&$form, &$form_state, $form_id) {
   // still uses the media_browser_form_submit callback
   if (current_path() == 'media/browser' && $form_id != 'views_exposed_form') {
     $form_state['#media_browser'] = TRUE;
+    if (isset($form_state['values']['op']) && $form_state['values']['op'] != t('Submit')) {
+      // We assume this is a tab related action mark it as selected tab
+      $form['media-selected-tab'] = array(
+        '#type' => 'hidden',
+        '#value' => $form_id,
+      );
+    }
   }
 
   // If the #media_browser key isset and is true we are using the browser
