What happens if a student takes pictures of a test and sends it to classmates that have not already taken it?
Your friend engaged in outright cheating. In nearly all universities, what they did is a major violation of the codes of conduct that students are rightly expected to abide by. This isn't a "grey area" situation, your friend knowingly did something that was very wrong and I cannot imagine that the university authorities will see much cause to show leniency in this case. Further, as there were likely only a limited number of student who took the test early, your friend is likely to be caught. The professors probably already suspect who it is and are gathering evidence. I doubt your friend will have time to go through the whole process of transferring before they are found out. Further, if one of the few students who took the test early suddenly applied to transfer, it would look quite suspicious.

In this situation, there really isn't much that your friend can do. The ethical thing to do would be to admit what they did and accept the consequences, with the faint hope that coming clean will lead to some degree of leniency. That said, if self preservation is the only concern, they can sure attempt to transfer before they are caught. 

As for you, as a budding academic, choose your colleagues and friends wisely. People's bad actions can rub off on you and they can bring you down with them. Someone willing to do this is a poor friend to have indeed.