What is the effect of viewing pornography on children? It is generally accepted that porn shouldn't be seen by children, and we even sometimes punish parents who fail to stop their children from finding porn.

How much are these laws based in science? Can a simple image cause real injury beyond mere disgust? Have there been any studies that track lives of people who were exposed to porn or other disturbing imagery as children or adolescents?

Note that I have also posted this question on parenting.SE.
Pornography laws are a relic of the Victorian era, and not based on any science.
Research that can conclusively determine the effect of pornography on children is hard to come by due to the resultant ethical environment.  Most research depends on self-reports: Surveys ask adolescents how much pornography they have been exposed to, and attempt to correlate this with other variables such as personal attitudes about sex.  Such surveys are subject to a variety of memory and other biases affecting accuracy, but more importantly, correlations fail to establish cause and effect - that is, it is equally likely that pornography consumption affects attitudes as it is that pre-existing attitudes affect pornography consumption.
Nonetheless, a number of reviews of current literature on adolescents conclude that there is an association between consumption of pornography and certain negative attitudes about sex, and promiscuous and/or risky sexual behaviour.  The reviews acknowledge that the data contains much contradictory evidence however, as well as failing to establish cause and effect.
UK Children's Commissioner's report (2013): &quot;Basically... Porn is everywhere&quot;
Owens et al (2012): &quot;The Impact of Internet Pornography on Adolescents&quot;
In contrast, a paper by Kendall (2006) found a correlation between pornography accessibility and rape for 15-19 year old adolescents - but in the opposite direction, that could be interpreted to mean that access to pornography reduces rape crime in this demographic.
Research on pre-adolescents is even more scant.  A more conclusive effect is seen between exposure to depictions of violence and negative effects on attitudes and behaviour, though these may be short-lived.  A landmark study from the 1960's (no longer ethical to replicate) demonstrated that children do role model from violent media.  The reviews listed above extend this finding to attitudes and behaviours of adolescents exposed to pornography depicting violence.  Evidence linking this to criminal offences in adulthood is still controversial however.
In adults, studies across multiple countries (eg, Diamond, Jozifkova, &amp; Weiss, 2010) have documented significant declines in physical sex offenses as accessibility of pornography increases, again suggesting the possibility that pornography provides a substitute for sex crimes.