Fix
I have no problem with subdirectories, it is more like a subdomain problem.
I am able to embed a gallery if I add the following code to the page.
$_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0 - strlen($_SERVER['PHP_SELF'])));
I would like to find a way to make this change globally.