Eight people have been convicted in France over their involvement in the 2020 beheading of a teacher who showed his pupils cartoons of the Prophet Mohammed.