avoid using globals when capturing TIFF warnings