### 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
int terrain_set = components[0].trim_prefix("terrain_set_").to_int();
		if (p_from_index < 0) {
			undo_redo_man->add_undo_method(ed_tile_set, "remove_terrain", terrain_set, p_to_pos < 0 ? ed_tile_set->get_terrains_count(terrain_set) : p_to_pos);
		}
	} else if (p_array_prefix == "navigation_layer_") {
		if (p_from_index < 0) {
			undo_redo_man->add_undo_method(ed_tile_set, "remove_navigation_layer", p_to_pos < 0 ? ed_tile_set->get_navigation_layers_count() : p_to_pos);
		}
	} else if (p_array_prefix == "custom_data_layer_") {
		if (p_from_index < 0) {
			undo_redo_man->add_undo_method(ed_tile_set, "remove_custom_data_layer", p_to_pos < 0 ? ed_tile_set->get_custom_data_layers_count() : p_to_pos);
		}
	}
	
	List<PropertyInfo> properties;
	ed_tile_set->get_property_list(&properties);
	for (PropertyInfo pi : properties) {
		if (pi.name.begins_with(p_array_prefix)) {
			String str = pi.name.trim_prefix(p_array_prefix);
			int to_char_index = 0;
			while (to_char_index < str.length()) {
				if (!is_digit(str[to_char_index])) {
					break;
				}
				to_char_index++;
			}
			if (to_char_index > 0) {
				int array_index = str.left(to_char_index).to_int();
				if (array_index >= begin && array_index < end) {
					ADD_UNDO(ed_tile_set, pi.name);