Create GUI for selecting, creating or opening image I am creating a material using a CustomShaderNodeGroup. The inner node tree has a texture, so I want to expose the texture parameters to the node UI. For doing so, I look for the texture inside the node tree and directly expose the different properties. But there is still one missing part I;m not sure how to do it. At the moment I have the following UI for my custom node:



As you can see, i have a similar UI as the original ImageTexture node, but I'm missing the open/new buttons and also the use fake user and all that stuff for the image itself as in the following image



With my current UI, the user can't open a new image, so this is a strong drawback. How could I make something more similar to the original ImageTexture UI?
UILayout.template_ID

For ID types like image use the template_ID method.  As seen by viewing source of the image editor space, where  sima = context.space_data 

layout.template_ID(sima, "image", new="image.new", open="image.open")



  What do you mean with the image editor space?


I mean look in blender for UI that matches, in this case I've arbitrarily used the header of the image editor. 



With developer extras turned on if right click on open button,  select view source the text editor will open code and point to the code above.  This is the image set to the image editor. 

In your case, going by answer simply change sima with env.  Will work for any blender object that has an image attribute that points to an image bpy.types.Image

Give some class an image

Can add an image to your custom class 

class Foo:
    image : bpy.props.PointerProperty(type=bpy.data.Image)


    def draw(self, context):
        layout = self.layout
        layout.template_ID(self, "image", new="image.new", open="image.open")