i can see a candidate for the man in prison in 1891,,,,this John Cassidy was b 1869 in Donegal...joined the munster fusiliers in 1889,,,deserted and was imprisoned in 1891,,then discharged in 1891 with ignomy. I dont think this this matches up with your John,,,but the John i mentioned does not have to be the same one who is in prison,,,
