Fixed database concurrency issues, improved server package structure,
and implemented a better method of getting galleries and database
sessions for a certain client