Tidy up query by uri - added support for returning a single row from a query rather than an array - added support for imagePath for large result template