Thumbnails is visible whether it is behind building or in front

Thumbnails is visible whether it is behind building or in front

Hello, I have no clue how to solve this problem

2 images in the middle are supposed to be behind the building