Use the prefix of the url to determine the protocol of the imagery service