Fixed crash because of out of bound index and fixed .gitignore

There is a crash sometimes if we change the _imagesArray thought the animateWith<...> methods while animating. This pull request fixes the issue.