Speedups to the annotation counts on images.