Handle query change to state in image search box