Here is the question that I've been asking all along being dealt with in Christianity Today. He raises the issue but I'm not sure I found the answer to the question. About the foundation of the movie and Anne Catherine Emmerich...
From Christianity Today:
The vision thing
Mel Gibson is in many ways a pre-Vatican II Roman Catholic. He prefers the Tridentine Latin Mass and calls Mary co-redemptrix. Early in the filming of The Passion, he gave a long interview to Raymond Arroyo on the conservative Catholic network EWTN. In that interview, Gibson told how actor Jim Caviezel, the film's Jesus, insisted on beginning each day of filming with the celebration of the Mass on the set. He also recounted a series of divine coincidences that led him to read the works of Anne Catherine Emmerich, a late-18th, early-19th-century Westphalian nun who had visions of the events of the Passion. Many of the details needed to fill out the Gospel accounts he drew from her book, Dolorous Passion of Our Lord.
Here is one such detail from Emmerich:
"[A]fter the flagellation, I saw Claudia Procles, the wife of Pilate, send some large pieces of linen to the Mother of God. I know not whether she thought that Jesus would be set free, and that his Mother would then require linen to dress his wounds, or whether this compassionate lady was aware of the use which would be made of her present. … I soon after saw Mary and Magdalen approach the pillar where Jesus had been scourged; … they knelt down on the ground near the pillar, and wiped up the sacred blood with the linen which Claudia Procles had sent."
Gibson does not follow Dolorous Passion slavishly, and at many points he chooses details that conflict with Emmerich's account. But the sight of Pilate's wife handing a stack of linen cloths to Jesus' mother allows Gibson to capture a moment of sympathy and compassion between the two women, and the act of the two Marys wiping up Jesus' blood gives Gibson the opportunity to pull back for a dramatic shot of the bloody pavement.
Another detail picked up from Dolorous Passion is just as dramatically powerful, but much more significant theologically. Emmerich writes that during Jesus' agony in the garden, Satan presented Jesus with a vision of all the sins of the human race. "Satan brought forward innumerable temptations, as he had formerly done in the desert, even daring to adduce various accusations against him." Satan, writes Emmerich, addressed Jesus "in words such as these: 'Takest thou even this sin upon thyself? Art thou willing to bear its penalty? Art thou prepared to satisfy for all these sins?'"