bulkUpload - uploading does not always work.

Silverstripe Version: 4.4.4

**Question: Uploading photos does not always work using bulkUploader. **


I have the following problem:
I have a page with an image gallery and I’m utilising BulkUploader as means to upload several photos. On my page I have the bulk upload filedrop area - the one with “Browse or Add from files” buttons. I normally have to upload photos through the popup window that shows up when I click “Add from files” .
I noticed that whenever I choose a photo and click “Insert” a POST request is made to “admin/assets/schema/fileSelectForm/{page_id}” but no errors are returned. This happens randomly and not always and I don’t really know how to approach this problem :confused:

Here’s the code I have:

// use ....

class GalleryPage extends Page{
	private static $many_many = [
		"GalleryItems" => "GalleryItem"
	private static $many_many_extraFields = [
		"GalleryItems" => ["SortOrder" => "Int"]

	private static $owns = ["GalleryItems"];

	public function getCMSFields(){
		$fields = parent::getCMSFields();
		$config = GridFieldConfig_RelationEditor::create();
		$config->addComponent($sortable = new GridFieldSortableRows("SortOrder"));
		$config->addComponent(new BulkUploader(null, null, true));
		    ->setUfSetup('setFolderName', '/');

		$gridField = new GridField("GalleryItems", "GalleryItems", $this->GalleryItems(), $config);
		$fields->addFieldToTab("Root.Images", $gridField);
		return $fields;



// use ...

class GalleryItem extends DataObject{
	private static $db = ["Description" => "Varchar(255)"];

	private static $has_one = [
		"Image" => Image::class,
		"Page" => "GalleryPage"

	private static $owns = [

	public function onAfterWrite() {
        if ($this->Image()->exists() && !$this->Image()->isPublished()) { 

	private static $summary_fields = ["Thumbnail", "Description"];

	public function getThumbnail() {...}

I hope I described the problem properly
Thank you in advance!