from typing import Optional
import requests
import re


def get_user_image(username: str) -> Optional[str]:
    """Return URL of the profile picture of a given user."""
    url = f"https://wt.social/u/{username}"
    response = requests.get(url)
    match = re.search(r"(https.*?--profile_pic\.\w+)", response.text)
    return match.group(1).replace("\\", "") if match else None