[TIMOB-11698] Ensure window is open before trying to display gallery
timob-9448: porting fix from https://github.com/appcelerator/titanium_mobile/pull/2389
Merge pull request #82 from hieupham007/timob-9448

timob-9448: porting button states fix
Merge pull request #80 from vishalduggal/timob-11698

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