Crops n-dimensional images in place