Image preview is missing

If Id like to upload images e.g. to Facebook, sometimes there is an image preview on the right of the highlighted file, sometimes not. It's quite annoying to go separately to Caja, choose files for upload, write their name down and then select them. Any solution?

As I understood from your post that when you want to upload something like Facebook, you want to choose a certain picture to be uploaded. When you click on a certain file it does not show the preview on the right section of the dialog !!

This is strange,, can you tell us what Ubuntu Mate Version are you using, do you have any compiz manager running ???

I am using 20.04.4 LTS.

What is that?

The simplest would be to go open Caja, press and hold ctrl or shift and select images.
Selected images can be dragged and dropped to e.g facebook, imgur.
I think it supports DnD operations when you select to upload images.
There may be a box where you can drop the files to upload.

No idea why it doesn't show the preview, I haven't seen the source code in the web browser that opens a Gtk file chooser dialog.

I wonder would it show preview if you save next script as
chooser.py and run it in terminal with python3 chooser.py

#!/usr/bin/env python3

from gi import require_version
require_version('Gtk', '3.0')
from gi.repository import Gtk

from gi.repository import GdkPixbuf

def update_preview(dialog):
    path= dialog.get_preview_filename()
    try:
        pixbuf= GdkPixbuf.Pixbuf.new_from_file(path)
    except Exception:
        dialog.set_preview_widget_active(False)
    else:
        #scale the image
        maxwidth, maxheight= 300.0, 700.0 # as floats to avoid integer division
        width, height= pixbuf.get_width(), pixbuf.get_height()
        scale= min(maxwidth/width, maxheight/height)
        if scale<1:
            width, height= int(width*scale), int(height*scale)
            pixbuf= pixbuf.scale_simple(width, height, GdkPixbuf.InterpType.BILINEAR)

        preview_image.set_from_pixbuf(pixbuf)
        dialog.set_preview_widget_active(True)

preview_image= Gtk.Image()
filechooserdialog = Gtk.FileChooserDialog()
filechooserdialog.set_title("FileChooserDialog")
filechooserdialog.add_button("_Open", Gtk.ResponseType.OK)
filechooserdialog.add_button("_Cancel", Gtk.ResponseType.CANCEL)
filechooserdialog.set_default_response(Gtk.ResponseType.OK)
filechooserdialog.set_select_multiple(True)
filechooserdialog.set_preview_widget(preview_image)

filter = Gtk.FileFilter ()
filter.add_pattern ("*.jpg")
filter.add_pattern ("*.jpeg")
filter.add_pattern ("*.png")
filechooserdialog.set_filter(filter)

filechooserdialog.connect('update-preview', update_preview)

response = filechooserdialog.run()

if response == Gtk.ResponseType.OK:
    for s in filechooserdialog.get_filenames():
        print("\'%s\'" % s , end =" ")
    print("")

filechooserdialog.destroy()