def update_service_image(s_name, services, image_uri):
    """
    Function to update the services and change the image_url

    :param s_name: name of the service to update or add in Docker ComposeX file
    :type s_name: string
    :param services: all the services as defined in Docker composex
    :type services: dict
    :param image_uri: New Docker image URL
    :type image_uri: str
    :return: services
    :rtype: dict
    """
    if s_name not in services.keys():
        service = {"image": image_uri, "labels": {"use_discovery": True}}
        services[s_name] = service
    else:
        service = services[s_name]
        service["image"] = image_uri
    return services