Add alignment to image processing functions