A Darwen teacher who took photos of children and then made them indecent using AI software has been jailed.