imageinfo: differentiate each failure case

Add exceptions (subclassing IdentificationError):
- NotEnoughData
- UnrecognizedFormat

Add corresponding test code.