Protect against imagetype = 0 returned for the buffered image just read (no idea where this is coming from, just happened while I was building)