Performance enhancements to similar image annotation assignment, plus unit test for copy function.