Ugoira "load sample first" support + Misc. fixes

* Updated to support the impending Danbooru change where ugoira's webm sample will be loaded first if the user has opted for samples over originals.
* Fixed a potential problem with the query portion for generated thumbnails where the query would end up set as "undefined".
* Fixed the random post hotkey for logged out users.
* Fixed an issue with wildcards and metatags by separating them from regular tags when creating a search.
* Fixed the detection of the notes search as a notes listing by making the match test more specific.
* Fixed post resizing for blacklisted posts that are hidden.