template scale_image_agg on image_data_type to squash code duplication