Replace substr with FileManager::strip_webroot; call jquery.filemanager.js from the gallery handler