.....
$("#testID #testID2").removeClass("test2").addClass("test3");
Because you have assigned an id to img too, you can simply do this too:
$("#testID2").removeClass("test2").addClass("test3");
And finally, you can do this too:
$("#testID img").removeClass("test2").addClass("test3");