Fixed issue with GIFLIB version>=5.1