I would propose that users posting a screenshot of code is useful, as it gives a clear indication that the user is unfit to be on SO as they are lacking the common sense to know that textual data should be represented as, well, text. It's probably futile to try to further extend the "ask question" guidance with an appropriate message, as the offending users already ignored the message that's shown when uploading an image.
In an ideal world, there would just be a close reason "image of code" which triggers an automatic suspension after the question has been closed as such. But SO leadership (kind of a misnomer at this point) would probably rather make us coddle the offending users than enforce any quality control, so meaningful repercussions are a pipe dream. Thus all we can do is downvote and closevote any offending questions. Or if you're feeling especially generous, answer any questions that contain pictures of code with pictures of a solution.