Have you tried solving the script issue using Custom Action with Location="ScriptLink". It load the javascript on all the site pages and even the dialogs. See I have solved the problem below:
All you need to do is to change the paths accordingly, of course put these custom actions in a feature (Site Collection/Web) :)
<CustomAction Location="ScriptLink" ScriptSrc="~SiteCollection/_layouts/js/jquery-1.5.2.js" Sequence="105" />
<CustomAction
Location="ScriptLink"
ScriptBlock="function loadImageUploaderScript() {
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
var url = window.location.toString();
url = typeof(L_Menu_BaseUrl) != 'undefined' ? L_Menu_BaseUrl : url.substr(0, url.indexOf('/_layouts'));
script.src = url + '/_layouts/js/DefaultUploadOff.js';
head.appendChild(script);
}
_spBodyOnLoadFunctionNames.push('loadImageUploaderScript()');" Sequence="120">
DefaultUploadOff.js file will look like as follows:
jQuery(document).ready(function () {
jQuery("#SiteMgr_Upload_ButtonTable").hide();
});
And if your jQuery doesn't work then you can use the following JavaScript code in DefaultUploadoff.js
var inputs = document.getElementsByTagName("table");
var i = 0;
for (i = 0; i < inputs.length; i++) {
var input = inputs[i];
if (input.id.indexOf('SiteMgr_Upload_ButtonTable') > -1)
document.getElementById('SiteMgr_Upload_ButtonTable').style.visibility = "hidden";
}