For image datasets, to convert Annotations into indices