Children in Scottish schools have used artificial intelligence to create sexual and violent images of their teachers to share them on social media.