Pool gallery CSS & Other fixes

* Updated the CSS so it gets along with the pool gallery view.
* Fixed a potential problem with the query portion for generated thumbnails where the query would end up set as "undefined".
* Fixed the unique ID function.
* Fixed the random post hotkey.
* Misc. cleanup and rearranging.