Tests written for query callbacks, implement next

Test driven devlopment used here, images also copied into the python app
implementation for query callbacks

using the tests written in last commit