/**
 * Given a dictionary of image data, remove any duplicate images.
 *
 * @param image_data A dictionary containing image data, where the keys are image names and the values are image paths.
 * @return A modified dictionary with duplicate images removed.
 */
fun removeDuplicates(imageData: Map<String, String>): Map<String, String> {

    val uniqueImages = mutableMapOf<String, String>() // Initialize an empty dictionary to store unique images
    val seenImages = mutableSetOf<String>() // Initialize an empty set to keep track of seen images

    for ((imageName, imagePath) in imageData) {
        if (imageName in seenImages) { // Check if the current image name has been seen before
            continue // Skip this iteration to ignore duplicate images
        }

        // Iterate over nested loops to check for duplicates
        for ((otherImageName, otherImagePath) in imageData) {
            if (imagePath == otherImagePath && imageName != otherImageName) {
                seenImages.add(imageName) // Add duplicate image name to seenImages set
                break // Break out of the nested loop
            }
        }

        uniqueImages[imageName] = imagePath // Add unique image to the new dictionary
    }

    return uniqueImages
}
/**
 * Given a dictionary of image data, remove any duplicate images.
 *
 * @param image_data A dictionary containing image data, where the keys are image names and the values are image paths.
 * @return A modified dictionary with duplicate images removed.
 */
fun removeDuplicates(imageData: Map<String, String>): Map<String, String> {
/**
 * Given a dictionary of image data, remove any duplicate images.
 *
 * @param image_data A dictionary containing image data, where the keys are image names and the values are image paths.
 * @return A modified dictionary with duplicate images removed.
 */
fun removeDuplicates(imageData: Map<String, String>): Map<String, String> {

    val uniqueImages = mutableMapOf<String, String>() // Initialize an empty dictionary to store unique images
    val seenImages = mutableSetOf<String>() // Initialize an empty set to keep track of seen images

    for ((imageName, imagePath) in imageData) {
        if (imageName in seenImages) { // Check if the current image name has been seen before
            continue // Skip this iteration to ignore duplicate images
        }

        // Iterate over nested loops to check for duplicates
        for ((otherImageName, otherImagePath) in imageData) {
            if (imagePath == otherImagePath && imageName != otherImageName) {
                seenImages.add(imageName) // Add duplicate image name to seenImages set
                break // Break out of the nested loop
            }
        }

        uniqueImages[imageName] = imagePath // Add unique image to the new dictionary
    }

    return uniqueImages
}