diff --git a/js/media.browser.js b/js/media.browser.js
index 3506263..3ee9366 100644
--- a/js/media.browser.js
+++ b/js/media.browser.js
@@ -7,7 +7,6 @@
 namespace('Drupal.media.browser');
 
 Drupal.media.browser.selectedMedia = [];
-Drupal.media.browser.activeTab = 0;
 Drupal.media.browser.mediaAdded = function () {};
 Drupal.media.browser.selectionFinalized = function (selectedMedia) {
   // This is intended to be overridden if a callee wants to be triggered
@@ -22,26 +21,35 @@ Drupal.behaviors.MediaBrowser = {
       // Fire a confirmation of some sort.
       Drupal.media.browser.finalizeSelection();
     }
-
+    
+    // Set all forms in tabs to pre-select the very same tab on submit
+    $('#media-browser-tabset .media-browser-tab').each(function(tabIndex) {
+      $('form', this).each(function() {
+          $(this).attr('action', $(this).attr('action') + '#' + tabIndex);
+      });
+    });
     // Instantiate the tabs.
     $('#media-browser-tabset').tabs({
+      selected: Drupal.media.browser.tabFromHash(),
       // Ensure that the modal resizes to the content on each tab switch.
-      show: Drupal.media.browser.resizeIframe
-    });
-
-    $('.ui-tabs-nav li').mouseup(function() {
-      Drupal.media.browser.activeTab = $(this).index();
+      show: function (event, ui) {
+        window.location.hash = $(ui.tab.parentNode).index();
+        Drupal.media.browser.resizeIframe(event);
+      }
     });
 
     $('.media-browser-tab').each( Drupal.media.browser.validateButtons );
-
-    Drupal.media.browser.selectActiveTab();
-    Drupal.media.browser.selectErrorTab();
-
   }
   // Wait for additional params to be passed in.
 };
 
+Drupal.media.browser.tabFromHash = function () {
+  if (window.location.hash && (index = parseInt(window.location.hash.substr(1))) && index != 'NaN') {
+    return index;
+  }
+  return 0;
+}
+
 Drupal.media.browser.launch = function () {
 
 };
@@ -112,29 +120,4 @@ Drupal.media.browser.resizeIframe = function (event) {
   $(parent.window.document).find('#mediaBrowser').height(h);
 };
 
-Drupal.media.browser.selectErrorTab = function() {
-  // Find the ID of a tab with an error in it
-  var errorTabID = $('#media-browser-tabset')
-    .find('.error')
-    .parents('.media-browser-tab')
-    .attr('id');
-
-  if (errorTabID !== undefined) {
-    // Find the Tab Link with errorTabID
-    var tab = $('a[href="#' + errorTabID + '"]');
-    // Find the index of the tab
-    var index = $('#media-browser-tabset a').index(tab);
-    // Select the tab
-    $('#media-browser-tabset').tabs('select', index)
-  }
-}
-
-Drupal.media.browser.selectActiveTab = function() {
-  // Find the index of the last active tab.
-  setTimeout(function() {
-    $('#media-browser-tabset').tabs('select', Drupal.media.browser.activeTab);
-    Drupal.media.browser.resizeIframe();
-  }, 10);
-};
-
 }(jQuery));
