/**
 * This function takes a list of tuples containing images and their corresponding categories,
 * and deletes the specified image from the list.
 *
 * @param tupleList A list of tuples in the format (image, category).
 * @param imageName The name of the image to be deleted.
 * @return The updated list of tuples without the deleted image.
 */
fun deleteImage(tupleList: MutableList<Pair<String, String>>, imageName: String): MutableList<Pair<String, String>> {

    // Iterate over the tuple list to find the image to be deleted
    val iterator = tupleList.iterator()
    while (iterator.hasNext()) {
        val currentTuple = iterator.next()
        if (currentTuple.first == imageName) { // Check if the image name matches
            iterator.remove() // Delete the tuple containing the image
            break // Exit the loop once the image is found and deleted
        }
    }
    return tupleList
}
/**
 * This function takes a list of tuples containing images and their corresponding categories,
 * and deletes the specified image from the list.
 *
 * @param tupleList A list of tuples in the format (image, category).
 * @param imageName The name of the image to be deleted.
 * @return The updated list of tuples without the deleted image.
 */
fun deleteImage(tupleList: MutableList<Pair<String, String>>, imageName: String): MutableList<Pair<String, String>> {
/**
 * This function takes a list of tuples containing images and their corresponding categories,
 * and deletes the specified image from the list.
 *
 * @param tupleList A list of tuples in the format (image, category).
 * @param imageName The name of the image to be deleted.
 * @return The updated list of tuples without the deleted image.
 */
fun deleteImage(tupleList: MutableList<Pair<String, String>>, imageName: String): MutableList<Pair<String, String>> {

    // Iterate over the tuple list to find the image to be deleted
    val iterator = tupleList.iterator()
    while (iterator.hasNext()) {
        val currentTuple = iterator.next()
        if (currentTuple.first == imageName) { // Check if the image name matches
            iterator.remove() // Delete the tuple containing the image
            break // Exit the loop once the image is found and deleted
        }
    }
    return tupleList
}