Added tests for image handling.
Added tests for term search query.
Cleaned up test.