samtto
Thanks for the suggestion, but I solved this problem in a different way.
There are two types of spoiler ">!!<" and ">!", the second option is not used by default (it is added through the extension), that is, users do not use it, so I went to the site settings and added changes to the CSS.
details.spoiler {
display:none}
This is how it looks
>!![](image link)
Now everything works. The image disappears, but the discussion thumbnail is updated.