i want to send the images selected with content not just names to post parrt "<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Image Selection</title>
    <style>
        body {
            font-family: 'Open Sans', sans-serif;
            background-color: #1f1f1f; /* Dark Grey */
            margin: 0;
            padding: 40px;
            color: #ddd; /* Light Grey */
            display: flex;
            justify-content: center; /* Center everything horizontally */
            align-items: center; /* Center everything vertically */
            height: 100vh; /* Full viewport height */
        }

        .container {
            width: 80%;
            max-width: 1200px; /* Max width for the container */
        }

        h2 {
            font-weight: 600;
            color: #4CAF50; /* Green */
            text-align: center;
        }

        .result-container {
            display: flex;
            flex-wrap: wrap;
            gap: 20px;
            justify-content: center; /* Center items */
        }

        .image-container {
            flex-basis: calc(33% - 20px); /* Adjusting width */
            background-color: #333; /* Dark Grey */
            padding: 10px;
            border-radius: 8px;
            box-shadow: 0px 4px 8px rgba(0,0,0,0.2);
        }

        img {
            width: 100%;
            max-width: 200px; /* Limiting image width */
            height: auto;
            border: 1px solid #444; /* Darker Grey */
            border-radius: 4px;
            margin-top: 10px;
            box-shadow: 0px 4px 8px rgba(0,0,0,0.05);
        }

        .select-all-container {
            margin-top: 20px;
            text-align: center;
        }

        .select-all-button {
            background-color: #4CAF50; /* Green */
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            transition: background-color 0.3s ease-in-out;
        }

        .select-all-button:hover {
            background-color: #45a049; /* Darker Green */
        }

        .process-button {
            background-color: #4CAF50; /* Green */
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            transition: background-color 0.3s ease-in-out;
        }

        .process-button:hover {
            background-color: #45a049; /* Darker Green */
        }
    </style>
</head>
<body>
    <div class="container">
        <h2>Available Images</h2>
        <form action="{{ url_for('process_images') }}" method="post" enctype="multipart/form-data" id="imageForm">
            <div class="result-container">
                {# Loop through the images dictionary available in the template context #}
                {% for image_name, image_data in images.items() %}
                <div class="image-container">
                    <input type="checkbox" id="image-{{ image_name }}" name="selected_images" value="{{ image_name }}">
                    <label for="image-{{ image_name }}">
                        <img src="data:image/jpeg;base64,{{ image_data }}" alt="Thumbnail of {{ image_name }}">
                    </label>
                </div>
                {% endfor %}
            </div>
            <div class="select-all-container">
                <button type="button" class="select-all-button" onclick="selectAll()">Select All</button>
                <button type="button" class="process-button" onclick="processImages()">Process Selected Images</button>
            </div>
        </form>
        
    </div>


    <script>
        function selectAll() {
            var checkboxes = document.querySelectorAll('input[name="selected_images"]');
            checkboxes.forEach(function(checkbox) {
                checkbox.checked = true;
            });
        }
    function processImages() {
        var selectedImages = [];
        var checkboxes = document.querySelectorAll('input[name="selected_images"]:checked');
        checkboxes.forEach(function(checkbox) {
            selectedImages.push(checkbox.value);
        });

        fetch("/process_images", {
            method: "POST",
            headers: {
                "Content-Type": "application/json"
            },
            body: JSON.stringify(selectedImages)
        })
        .then(response => {
            if (!response.ok) {
                throw new Error("Network response was not ok");
            }
            return response.json();
        })
        .then(data => {
            // Handle the response data
            console.log(data);
        })
        .catch(error => {
            console.error("There was a problem with the fetch operation:", error);
        });
    }
</script>


</body>
</html>