Replace ASSERT in ImageRec::read with a more gentle failure

Reported hitting of this assertion. Remove it and pass the error back, maybe this will give a better error message than just crashing.