I have a problem with collapsing element inside a repeater in Editor X

I’m trying to collapse an element inside a repeater (If there is no image in the database collection).
I put the elements in a grid, and streched the image (the top element) to the grid section. It’s not collapsing.
It’s not because of the code - I also tried to collapse the item from the start, as you can see in the image - but it still not collapsing.
I set the height of the container to auto.

On the editor - it looks like this:

On the live site - the image is not collapsing.

Do you have any idea what’s wrong?