Ways to imagine a computer program for a student without photographic visualisation
This may sidestep the question a bit, but perhaps you can have the student make physical drafts of what they want their program to do at first, kind of like making multiple drafts of essays.
As an undergraduate, I sometimes joked that I used an awful lot of paper for a computer science student. I found that dumping everything from my head or even the problem statement onto pieces of paper (more portable) or a very large whiteboard helped me to organize my thoughts and eventually figure out what I wanted to do for my harder programming assignments as well as the problem sets in my algorithms class. I also did this when I was just starting out in CS and programming, just on a smaller scale and not for very long. This was especially helpful when I was learning about recursion.
I also found this helpful for helping students when I was a TA for the CS department's discrete mathematics course, which was taught in two different styles: paper and pencil, and with a theorem prover language (Lean) (a lot of students felt like it was programming). It especially helped for the latter style, as students sometimes knew what they wanted to do in a proof but couldn't figure out how to express the proof in Lean because they didn't understand how they were supposed to understand the syntax. Based on what some of those students said, I think drawing everything out for them helped them to eventually visualize on their own.
If the student is just starting out with programming, the drafts shouldn't be too complex yet, so hopefully they won't be too taxing and they can be a stepping stone to eventually being able to getting mental images of program structures.