ELGIN, Ill. (AP) — A federal judge faces questions about terminal illness and just punishment when he sentences a former Illinois lawmaker for compiling and trading hundreds of pornographic images online of toddlers and other children.

The judge will impose some prison term on former Rep. Keith Farnham at Thursday’s sentencing. The 67-year-old Elgin Democrat faces a mandatory minimum prison sentence of five years for transporting child pornography.

But Farnham suffers from lung disease and is thought to have just months to live. So the big question is whether U.S. District Judge Edmond Chang will send him to die behind bars or let him serve his sentence at home under house arrest.

Chang took the rare step of moving sentencing from Chicago to a state courthouse near Farnham’s home due to his poor health.

(TM and © Copyright 2015 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)