[Fix][gifs] Fix stack corruption caused by a too high initial code size (max is 11 bits).
[Fix][gif] Fix "Prevent Translation table overflow" check.
[Fix][gif] Check image dimensions.
Merge pull request #4231 from ace20022/fix_gifs

[Fix] Some fixes for our gif decode implementation