Supreme Court rules for sex offender in child pornography case testing power of judges, juries