Fix imageryProviders Bug

Sometimes imageryProviders is null so accessing providers.length on
line 255 causes a TypeError.
Merge pull request #919 from IJMacD/patch-1

Fix imageryProviders Bug (p=@IJMacD,r=@marcjansen)