A couple of addional notes:
1. I am not getting any Javascirpt or sever errors
2. When it breaks, the <script> block that is written to the client is incomplete. It stops immediately after "Categories;", and the <script> block is not closed, which explains why it messes up the rendering of my page.
<script type='text/javascript'>var thegallerybrowser=new GalleryBrowser(
{ClientID:'ctl00_imgGallery',UniqueID:'ctl00$imgGallery',Folder:'/CuteSoft_Client/Gallery/',LoadHandler:'Load.ashx',Theme:'Classic',Culture:'en-US',Layout:'Slideshow',Slider:'NewWin',Viewer:'LightBox',Popup:'Default',Editor:'Explorer',LogonUserID:null,LogonUserName:null,AllowEdit:null,AllowPostComment:null,AllowShowComment:null
,ScriptOption:{}
,Categories: