avoid stack overflow error when taking screenshot throws exception
Merge pull request #542 from zanata/stackoverflow

avoid stack overflow error when taking screenshot throws exception