Fix compilation with giflib-5 and later

This still works with giflib-4.