### Godot version

4.1.stable

### System information

Godot v4.1.stable - Windows 10.0.19045 - Vulkan (Compatibility) - Intel(R) HD Graphics 4600 (Intel Corporation; 20.19.15.5126) - Intel(R) Core(TM) i3-4330 CPU @ 3.50GHz (4 Threads)

### Issue description

When I try to join 68 images of 128x128 resolution in an atlas it returns a transparent 1x1 image

I tried using few images and it doesn't work either

It doesn't work either with 16x16, 32x32, 64x64 resolutions

- Google Translate :)

### Steps to reproduce


https://github.com/godotengine/godot/assets/136469511/ca5f64c2-f0c5-486f-a13e-b941ae2dea7d



### Minimal reproduction project

N/A
tile_set_atlas_source_editor = memnew(TileSetAtlasSourceEditor);
	tile_set_atlas_source_editor->set_h_size_flags(SIZE_EXPAND_FILL);
	tile_set_atlas_source_editor->set_v_size_flags(SIZE_EXPAND_FILL);
	tile_set_atlas_source_editor->connect("source_id_changed", callable_mp(this, &TileSetEditor::_update_sources_list));
	split_container_right_side->add_child(tile_set_atlas_source_editor);
	tile_set_atlas_source_editor->hide();
	
	tile_set_scenes_collection_source_editor = memnew(TileSetScenesCollectionSourceEditor);
	tile_set_scenes_collection_source_editor->set_h_size_flags(SIZE_EXPAND_FILL);
	tile_set_scenes_collection_source_editor->set_v_size_flags(SIZE_EXPAND_FILL);
	tile_set_scenes_collection_source_editor->connect("source_id_changed", callable_mp(this, &TileSetEditor::_update_sources_list));
	split_container_right_side->add_child(tile_set_scenes_collection_source_editor);
	tile_set_scenes_collection_source_editor->hide();
	
	int thumbnail_size = 64;
	patterns_item_list = memnew(ItemList);
	patterns_item_list->set_max_columns(0);
	patterns_item_list->set_icon_mode(ItemList::ICON_MODE_TOP);
	patterns_item_list->set_fixed_column_width(thumbnail_size * 3 / 2);
	patterns_item_list->set_max_text_lines(2);
	patterns_item_list->set_fixed_icon_size(Size2(thumbnail_size, thumbnail_size));
	patterns_item_list->set_v_size_flags(Control::SIZE_EXPAND_FILL);
	patterns_item_list->connect("gui_input", callable_mp(this, &TileSetEditor::_patterns_item_list_gui_input));
	main_vb->add_child(patterns_item_list);
	patterns_item_list->hide();
	patterns_help_label = memnew(Label);
	patterns_help_label->set_text(TTR("Add new patterns in the TileMap editing mode."));
	patterns_help_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
	patterns_help_label->set_anchors_and_offsets_preset(Control::PRESET_CENTER);