Man catches sex offender who took photos of children