You would do this.
1. Change the urls and server paths in global options in admin first and save
2. move everything from the gallery directory to your webroot
3. edit the config files and update any server paths urls.
4. You can then login and be fine except for one last step go to storage options in admin and hit revert and save twice to load the default new paths and urls