def _get_default_image_id(module):
    """
    Return the image_id if the image_id was specified through "source_details" or None.
    """
    if "source_details" in module.params and module.params["source_details"]:
        source_details = module.params["source_details"]
        source_type = source_details.get("source_type")
        if not source_type:
            if "source_type" not in source_details:
                module.fail_json(
                    msg="source_type required and must be one of: 'bootVolume', 'image'"
                )
        if source_type == "image":
            return source_details["image_id"]
    return None