No, I meant the size of dim0 should be at least that large.
You are passing image to the function, so you shouldn’t replace it with a int.
How would you like to index image if it’s only a single grayscale image?
Would you like to index in another dimension?