Dimensions in getLayerFromContext()

Properly handle dimensions to get the correct param values when creating a layer from a context.