IO: add specific exceptions in PNG and TIFF codecs