I want you to modify the below python code to display the concerned image along with the conversation when we load a previous conversation. Do not modify anything else, as everything else is working fine:

import streamlit as st
import ollama
from PIL import Image
import io
import json
from datetime import datetime
import os
import shutil

def delete_conversation(filename):
    json_path = os.path.join('conversations', filename)
    if os.path.exists(json_path):
        os.remove(json_path)
    
    image_filename = f"image_{filename.split('_')[1].split('.')[0]}.png"
    image_path = os.path.join('conversations', image_filename)
    if os.path.exists(image_path):
        os.remove(image_path)

def save_conversation(messages, context, image=None):
    if not messages:
        return None
        
    if not os.path.exists('conversations'):
        os.makedirs('conversations')
    
    timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
    
    conversation_data = {
        'timestamp': timestamp,
        'messages': messages,
        'context': context
    }
    
    filename = f'conversations/conversation_{timestamp}.json'
    with open(filename, 'w') as f:
        json.dump(conversation_data, f, indent=4)
    
    if image:
        image_filename = f'conversations/image_{timestamp}.png'
        image.save(image_filename)
    
    return filename

def load_conversation(filename):
    # Load conversation data
    with open(filename, 'r') as f:
        conv_data = json.load(f)
    
    # Try to load associated image
    timestamp = filename.split('_')[1].split('.')[0]
    image_filename = f'conversations/image_{timestamp}.png'
    image = None
    if os.path.exists(image_filename):
        try:
            image = Image.open(image_filename)
        except Exception as e:
            print(f"Error loading image: {e}")
    
    return conv_data, image

def get_saved_conversations():
    if not os.path.exists('conversations'):
        return []
    files = [f for f in os.listdir('conversations') if f.endswith('.json')]
    conversations = []
    for file in files:
        with open(os.path.join('conversations', file), 'r') as f:
            data = json.load(f)
            conversations.append({
                'filename': file,
                'timestamp': data['timestamp'],
                'preview': data['messages'][0]['content'] if data['messages'] else 'Empty conversation'
            })
    return sorted(conversations, key=lambda x: x['timestamp'], reverse=True)

def process_image_and_text(image, text_prompt, messages_history, context):
    if image is not None:
        img_byte_arr = io.BytesIO()
        image.save(img_byte_arr, format=image.format)
        img_byte_arr = img_byte_arr.getvalue()
        
        system_prompt = {
            "role": "system",
            "content": """You are an AI assistant that provides accurate image analysis. 
            Follow these guidelines:
            1. Only make statements that you can verify from the image
            2. If you are unsure about something, explicitly state your uncertainty
            3. Consider the provided context for better understanding
            4. Maintain consistency with previous responses
            5. Focus on factual observations rather than assumptions"""
        }
        
        max_history = 5
        recent_messages = messages_history[-max_history:] if len(messages_history) > max_history else messages_history
        
        contextualized_prompt = (
            f"Context: {context}\nQuestion: {text_prompt}" 
            if context 
            else text_prompt
        )
        
        try:
            response = ollama.chat(
                model='llama3.2-vision',
                messages=[
                    system_prompt,
                    *recent_messages,
                    {
                        'role': 'user',
                        'content': contextualized_prompt,
                        'images': [img_byte_arr]
                    }
                ]
            )
            return response['message']['content']
        except Exception as e:
            return f"Error processing request: {str(e)}"
    return "Please upload an image first"

def clear_image_state():
    st.session_state.current_image = None
    st.session_state.uploaded_file = None
    if 'file_uploader_key' not in st.session_state:
        st.session_state.file_uploader_key = 0
    st.session_state.file_uploader_key += 1

def clear_all_state():
    st.session_state.messages = []
    st.session_state.context = ""
    st.session_state.is_loading_conversation = False
    clear_image_state()

def main():
    st.set_page_config(
        page_title="Enhanced Image Analysis with Ollama",
        page_icon="🔍",
        layout="wide"
    )
    
    # Initialize session states
    if 'messages' not in st.session_state:
        st.session_state.messages = []
    if 'current_image' not in st.session_state:
        st.session_state.current_image = None
    if 'uploaded_file' not in st.session_state:
        st.session_state.uploaded_file = None
    if 'context' not in st.session_state:
        st.session_state.context = ""
    if 'is_loading_conversation' not in st.session_state:
        st.session_state.is_loading_conversation = False
    if 'file_uploader_key' not in st.session_state:
        st.session_state.file_uploader_key = 0
    
    st.title("Enhanced Image Analysis with Ollama Vision Model")
    
    with st.sidebar:
        st.header("Conversation Management")
        
        st.subheader("Context Management")
        st.session_state.context = st.text_area(
            "Add context for the conversation",
            st.session_state.context,
            help="Add any relevant context that should be considered during the analysis"
        )
        
        if st.button("New Conversation"):
            if st.session_state.messages and not st.session_state.is_loading_conversation:
                save_conversation(
                    st.session_state.messages,
                    st.session_state.context,
                    st.session_state.current_image
                )
            clear_all_state()
            st.rerun()
        
        if st.button("Clear Current Conversation"):
            clear_all_state()
            st.rerun()
        
        st.header("Previous Conversations")
        conversations = get_saved_conversations()
        for conv in conversations:
            col1, col2 = st.columns([3, 1])
            with col1:
                if st.button(f"Load: {conv['timestamp']}", key=f"load_{conv['filename']}"):
                    loaded_conv, loaded_image = load_conversation(os.path.join('conversations', conv['filename']))
                    st.session_state.messages = loaded_conv['messages']
                    st.session_state.context = loaded_conv.get('context', '')
                    st.session_state.is_loading_conversation = True
                    if loaded_image:
                        st.session_state.current_image = loaded_image
                    st.rerun()
            with col2:
                if st.button("🗑️", key=f"delete_{conv['filename']}"):
                    delete_conversation(conv['filename'])
                    st.rerun()
        
        if st.button("Delete All Conversations"):
            if os.path.exists('conversations'):
                shutil.rmtree('conversations')
            st.rerun()
    
    col1, col2 = st.columns(2)
    
    with col1:
        uploaded_file = st.file_uploader(
            "Choose an image...",
            type=['png', 'jpg', 'jpeg'],
            key=f"file_uploader_{st.session_state.file_uploader_key}"
        )
        
        # Display either uploaded image or loaded image
        if uploaded_file is not None:
            image = Image.open(uploaded_file)
            st.session_state.current_image = image
            st.image(image, caption='Uploaded Image', use_container_width=True)
        elif st.session_state.current_image is not None:
            st.image(st.session_state.current_image, caption='Loaded Image', use_container_width=True)
    
    for message in st.session_state.messages:
        with st.chat_message(message["role"]):
            st.markdown(message["content"])
    
    if prompt := st.chat_input("Enter your prompt here"):
        with st.chat_message("user"):
            st.markdown(prompt)
        
        st.session_state.messages.append({"role": "user", "content": prompt})
        
        if st.session_state.current_image is not None:
            with st.spinner('Processing...'):
                messages_history = [
                    {"role": m["role"], "content": m["content"]}
                    for m in st.session_state.messages[:-1]
                ]
                response = process_image_and_text(
                    st.session_state.current_image,
                    prompt,
                    messages_history,
                    st.session_state.context
                )
                
                with st.chat_message("assistant"):
                    st.markdown(response)
                
                st.session_state.messages.append({"role": "assistant", "content": response})
        else:
            st.error("Please upload an image")

if __name__ == "__main__":
    main()