reduce dimension of array during slicing if appropriate