improved image error management (with error cache, up to 100 entries by
default).
fix some errors.