Yup, we had this last week, DS got an image in his head that frightened him and it took three days for it to go away. I also get this sometimes, so I know what he's going through.
I know I keep tossing out the same toolbox, but in this case, the workbook on OCD "What To Do When Your Brain Gets Stuck" has been very helpful to us - not that DS has OCD, but this sort of thing is very similar, and it gave us a good language to talk about what's happening. Basically, the premise is that some people's brains don't "throw away" "garbage thoughts" and it causes them undue stress and anxiety (which, in the case of someone with OCD leads to ritual behavior, but DS doesn't have that and I was very careful to explain that the book only applied to him in part.)
It's the negative side of the wonderful memories that some of our kids have. For instance, DS is really struggling at school with the concept of "study," one teacher is asking them for a certain number of study minutes - and DS basically photographs the page he's supposed to be "studying" with that brain of his, and he's got it FOREVER. Great for science class...not so great when it's the moment when you are surprised and horrified by a gory halloween decoration in one of those stupid costume stores.
(We have night terrors, too - and they do look like that, but DS isn't usually coherent so we can kind of tell that he's asleep even though his eyes are open and he's walking around.)