There was a case in the UK a few years ago where Chris Langham, an actor, was arrested for looking at indecent images of minors. The actor's defense was that he was about to play a pedophile in a TV show and this was research. Apparently, the judge even stated that:
"Pedophilia is not an issue in this case" and [Langham] "is not a sexual predator".
Let us assume, for the sake of this question, that the actor's defense was indeed true and the only reason he wanted access to indecent images of minors was for research. Is it possible for someone to access and view such images, or any other illegal content, in a jurisdiction in which such access is illegal and not risk legal consequences? Consider, for example, a legitimate academic study on the prevalence and spread of child abuse in society. Or, since in the UK possession of terrorist propaganda is also illegal, a study of terrorist groups and their methods of recruitment
Since this is obviously a sensitive subject, I want to clarify that this question is emphatically not asking for any tips on accessing such content. If the question is impossible to answer without giving information that would make it easier for someone to find or view such images, then please close it!
I am simply wondering if it could be done legally if someone needed to see the images for actual research. Perhaps by contacting the police in advance? Or even viewing them under police supervision?