in reply to timtowtdi but which is the [quote fingers]best[/quote fingers]

Going back to your first thought-

s/TRUE/1/imgsx; s/FALSE/0/imgsx;

Except the g those flags are all noise or a mistake given your spec. E.g., "Falsely" will become "0ly."