Refactor GIF Support
Refactor numberOfImages access for GIF better support