Handle query with grace

If a query is given, we search for any closely matching image. We then
return a random image from the resulting match list. If no matches are
found, we return a random image.
Remove jQuery
Refactor
Merge pull request #1 from tinifni/better-query-handling

Handle query with grace