How to add multiples files to ReferenceImageLibrary simultaneously

I’m a noobie to unity, currently trying to do a Image Tracking project for multiple images. I have around 1500 images to track and the first 400 i have inserted manually to the reference image library one by one. I tried the below code to import the rest of the images, however even after selecting an image, it still shows None (Texture 2D) for it’s respective element. Any idea what causing the issue ?

using UnityEngine;
using UnityEngine.XR.ARSubsystems;

namespace UnityEditor.XR.ARSubsystems
{
    public class AutomateXR : EditorWindow
    {
        public Texture2D[] images;
        public XRReferenceImageLibrary library;

        [MenuItem("Window/Automate Ref Library Entries")]
        static void Init()
        {
            AutomateXR window = (AutomateXR)EditorWindow.GetWindow(typeof(AutomateXR));
            window.Show();
        }

        void OnGUI()
        {
            library = (XRReferenceImageLibrary)EditorGUILayout.ObjectField(library, typeof(XRReferenceImageLibrary), true);
            SerializedObject so = new SerializedObject(this);
            SerializedProperty stringsProperty = so.FindProperty("images");
            EditorGUILayout.PropertyField(stringsProperty, true);
            so.ApplyModifiedProperties();
            if (GUILayout.Button("Add items"))
            {
                AddItems();
            }
        }

        void AddItems()
        {
            foreach (Texture2D item in images)
            {
                library.Add();
                int index = library.count - 1;

                library.SetTexture(index, item, true);
                library.SetName(index, item.name);
                //library.SetSize(index, new Vector2(1, 1));
                //library.SetSpecifySize(index, true);
            }
        }
    }
}