[TIMOB-11698] 3_0_X Ensure window is open before trying to display gallery

Backport of PR #80 to 3_0_X
Test is in [JIRA](https://jira.appcelerator.org/browse/TIMOB-11698)