finnally found the solution after long hours of internet search.
you must add these 2 lines :
def create_image(image_data, width, height, image_tag, texture_tag):
with dpg.texture_registry():
texture_id = dpg.add_static_texture(width, height, image_data, tag=texture_tag)
# Add the image with drag and drop functionality
dpg.add_image_button(texture_id, tag=image_tag, payload_type="image_payload", drag_callback=drag_callback, drop_callback=drop_callback)
# add this to enable drap&drop:
with dpg.drag_payload(parent=image_tag, drag_data="dragdata", payload_type="image_payload"):
dpg.add_text("popup drag")