Former NH teacher avoids jail on nude photo charge