His girlfriend grew suspicious and looked at his phone to discover his collection of indecent images of children