text: Title: How to replace gr.ImageEditor uploaded user image and still keep image editing features
  Body: ### Describe the bug 
  
  **gradio==5.4.0**
  
  I want to auto resize / crop user uploaded image and replace processed image inside in gr.ImageEditor
  
  Here the code I use 
  
  So after image edited the image editing features disappears
  
  Here what I mean
  
  ```
  imgs = gr.ImageEditor(sources='upload', type="pil", label='Human. Mask with pen or use auto-masking', interactive=True)
  
      def process_editor_image(image_dict, enable_processing):
          if not enable_processing or image_dict is None:
              return image_dict
          if isinstance(image_dict, dict) and 'background' in image_dict:
              image_dict['background'] = process_image_to_768x1024(image_dict['background'])
          return image_dict
  
      def process_single_image(image, enable_processing):
          if not enable_processing or image is None:
              return image
          return process_image_to_768x1024(image)
  
      # Add image processing event handlers
      imgs.upload(
          fn=process_editor_image,
          inputs=[imgs, auto_process],
          outputs=imgs,
      )
  
  
  def process_image_to_768x1024(img):
      if not isinstance(img, Image.Image):
          return img
          
      # Create a new white background image
      target_width, target_height = 768, 1024
      new_img = Image.new('RGB', (target_width, target_height), 'white')
      
      # Calculate aspect ratios
      aspect_ratio = img.width / img.height
      target_aspect = target_width / target_height
      
      if aspect_ratio > target_aspect:
          # Image is wider than target
          new_width = target_width
          new_height = int(target_width / aspect_ratio)
          resize_img = img.resize((new_width, new_height), Image.Resampling.LANCZOS)
          paste_y = (target_height - new_height) // 2
          new_img.paste(resize_img, (0, paste_y))
      else:
          # Image is taller than target
          new_height = target_height
          new_width = int(target_height * aspect_ratio)
          resize_img = img.resize((new_width, new_height), Image.Resampling.LANCZOS)
          paste_x = (target_width - new_width) // 2
          new_img.paste(resize_img, (paste_x, 0))
      
      return new_img
  
  def process_uploaded_image(img, enable_processing):
      if not enable_processing or img is None:
          return img
      if isinstance(img, dict):  # For ImageEditor
          if img.get('background'):
              img['background'] = process_image_to_768x1024(img['background'])
          return img
      return process_image_to_768x1024(img)
  ```
  
  ![image](https://github.com/user-attachments/assets/a1f0685a-fe4c-44c9-879c-a17aafbce492)
  
  ![image](https://github.com/user-attachments/assets/288f16a7-0d6a-4641-81f6-350722c2aeda)
  
  