Lawmakers have approved tougher penalties for people caught possessing or selling child pornography after a high-profile case earlier this year spurred calls for change.