There's no need to ever return an ImageryLayer instead of an ImageryProvider.  It looks like you are doing it because you want to set an alpha value, but you can do that now with the ImageryProvider by setting the `defaultAlpha` property.  I just checked and this isn't properly documented, so that's a separate issue which I will write up.