import re


def md_correct_image_link(md: str, image_name: str, image_path: str) -> str:
    """Change image link at markdown text from local source to image_path.

    Args:
        md (str): Markdown text to process.
        image_name (str): Name for image file.
        image_path (str): Dir name for images at destination.

    Returns:
        str: Text with changed links.
    """
    return re.sub(
        rf"(\!\[.*\])(\s*\(\s*){image_name}(\s*\))",
        rf"\1({image_path}/{image_name})",
        md,
    )