How to use BPY to create an Image empty?

I’m trying to create a Python script to add an Image empty object. I managed to create the empty object and to load the image into Blender, but I don’t know how to associate one with the other…

My code so far:

bpy.ops.object.add(type = ‘EMPTY’)
context.object.name = ‘ICON’
context.object.empty_draw_type = ‘IMAGE’
context.object.empty_draw_size = 5
bpy.ops.image.open(filepath = ‘C:/images/myicon.png’)

Better not use operators for this:

import bpy

sce = bpy.context.scene
img = bpy.data.images.load(filepath="C:/images/myicon.png")

empty = bpy.data.objects.new("ICON", None)
empty.empty_draw_type = 'IMAGE'
empty.empty_draw_size = 5
empty.data = img

sce.objects.link(empty)
sce.update()