Fix for "No theme CSS loaded", when galleria is loaded dynamically through jquery-ui-tabs

Fix for "No theme CSS loaded", when galleria is loaded dynamically through JS and AJAX

Galleria may be inserted into the dom dynamically (e.g. via JavaScript loaded from an AJAX-Request). In such a case, the theme's script-tag seems not to be immediately present in the DOM when the addTheme-function looks for it. We therefore try multiple times before raising an error.


I haven't set up an example page for this bug. The problem has occured on our internal test-system and it is not reachable from the internet at the moment. 
We use $.ajax({ dataType: 'script', url: ...}) to load a script that inserts galleria into the DOM. In this case, IE8/9 (haven't tested IE10) fails to load our custom galleria-theme.