add giflib5 support to codebase

Regarding improvement/issue request #11759 , this patch as mentioned in subject adds support for use of giflib5 in phantomjs