I have succesfully managed to hide variants which are out of stock. Sadly, this doesn't apply to the images linked to that variant.
I am not a code-writer, but can manage copy/paste and locating source.
Is it possible to hide the image linked to the out of stock variant?
Did you ever figure out how to hide the variant images that were out of stock? I'm having the same problem.