### Godot version

v4.1.beta (a83eb16fb)

### System information

Godot v4.1.beta (a83eb16fb) - Ubuntu 20.04.2 LTS (Focal Fossa) - Vulkan (Compatibility) - NVIDIA GeForce GTX 1050 (nvidia; 470.182.03) - AMD Ryzen 7 3700X 8-Core Processor (16 Threads)

### Issue description

As the title said, an empty image will create an invalid texture and cause crash when the TexturePreview uses it.

_godot/editor/plugins/texture_editor_plugin.cpp_

```
void EditorInspectorPluginTexture::parse_begin(Object *p_object) {
	Ref<Texture> texture(Object::cast_to<Texture>(p_object));
	if (texture.is_null()) {
		Ref<Image> image(Object::cast_to<Image>(p_object));
		texture = ImageTexture::create_from_image(image);
                
                // add this below line will fix this.
                ERR_FAIL_COND_MSG(texture == nullptr, "Failed to created texture from invalid image.");
	}

	add_custom_control(memnew(TexturePreview(texture, true)));
}
```
Add sanity check after create texture will fix this. I can open a new pr to fix this if you think this is a right solution.   

![Peek 2023-06-17 12-50](https://github.com/godotengine/godot/assets/37368540/50ab9761-4268-4a9b-b951-697e8bd635de)


### Steps to reproduce

Add a new metadata with type```Resource```, after that new a ```Image``` type.

### Minimal reproduction project

No
mipmap_increase *= 0.25;
		}
		memory *= mipmaps_multiplier;
		if (mipmaps >= 1) {
			metadata_label->set_text(
					vformat(String::utf8("%d×%d %s\n") + TTR("%s Mipmaps") + "\n" + TTR("Memory: %s"),
							texture->get_width(),
							texture->get_height(),
							format,
							mipmaps,
							String::humanize_size(memory)));
		} else {
			/
			/
			metadata_label->set_text(
					vformat(String::utf8("%d×%d %s\n") + TTR("No Mipmaps") + "\n" + TTR("Memory: %s"),
							texture->get_width(),
							texture->get_height(),
							format,
							String::humanize_size(memory)));
		}
	} else {
		metadata_label->set_text(
				vformat(String::utf8("%d×%d %s"),
						texture->get_width(),
						texture->get_height(),
						format));
	}
}
TexturePreview::TexturePreview(Ref<Texture2D> p_texture, bool p_show_metadata) {