Images make it past sticky heading

as you can see in the gif, the images keep making it past the sticky heading. I dont understand why its only the images. I dont know how to fix it.
The css for the heading:

.sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  background: linear-gradient(#41B6B6, #9E41B6);
}

You can give the heading a “z-index” of any values higher than 1 to have more priority than images,like “z-index:22” or any other number. This will make heading cover the images.