Skip to content

Duplicate Images When Adding Image Form Gallery In Magento 2.4.5

I am using Image Uploader component to upload multiple images. But when I click ‘Select from Gallery’ -> select image -> ‘Add Selected’, it gets duplicate images.
How do I get the correct image without duplicates?

<field formElement="imageUploader" name="slider">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="source" xsi:type="string">slider</item>
                <item name="scopeLabel" xsi:type="string">[Global]</item>
                <item name="isMultipleFiles" xsi:type="boolean">true</item>
            </item>
        </argument>
        <settings>
            <elementTmpl>ui/form/element/uploader/image</elementTmpl>
            <dataType>string</dataType>
            <label translate="true">Slider</label>
            <visible>true</visible>
            <imports>
                <link name="disabled">${ $.provider}:data.hide_it</link>
            </imports>
        </settings>
        <formElements>
            <imageUploader>
                <settings>
                    <required>true</required>
                    <uploaderConfig>
                        <param xsi:type="url" name="url" path="eventbooking/event/uploadimage"/>
                    </uploaderConfig>
                    <previewTmpl>Magento_Catalog/image-preview</previewTmpl>
                    <allowedExtensions>jpg jpeg gif png</allowedExtensions>
                    <maxFileSize>4194304</maxFileSize>
                </settings>
            </imageUploader>
        </formElements>
    </field>

enter image description here