Fixes themelet 'undefined variable query' errors

My install seems to give me an error in the Themelet built_thumb_html functions:
`Notice: Undefined variable: query in /www/shimmie2/themes/danbooru2/themelet.class.php on line 5`

Seems to go away if we add $query to globals, so I thought it'd be nice to put in the rest of them.