async def METHOD_NAME(db: Session, file: UploadFile(None)):
    """
    Upload an image file.
    This function saves an uploaded image file to the specified directory and returns the filename.
    Args:
        db (Session): SQLAlchemy database session.
        file (UploadFile): The uploaded image file.
    Returns:
        str: The filename of the uploaded image.
    """
    # Check if file with the same name exists
    filename = file.filename
    file_path = f"{IMAGEDIR}{filename}"
    while os.path.exists(file_path):
        # Generate a random character
        random_char = ''.join(random.choices(string.ascii_letters + string.digits, k=3))
        # Add the random character to the filename
        logo_name, extension = os.path.splitext(filename)
        filename = f"{logo_name}_{random_char}{extension}"
        file_path = f"{IMAGEDIR}{filename}"
    # Read the file contents
    contents = await file.read()
    # Save the file
    with open(file_path, "wb") as f:
        f.write(contents)
    return filename