Merge pull request #49 from ku-fpg/gradient

Factor gradients out of Query
Merge branch 'master' into image