Other plugins use
doc->getSelect()
which returns a list of selected objects.
When the polygon is created as polyline, then selected with image, you should get 2 objects.
One is the polyline, the other the image.
I don't know what getEnt() and getData() will return for polyline and image, but I assume that it should be possible to extract the vertices from these data and also the image path and location.
But I never used image or polyline in plugins, so it's also possible, that the interface lacks functionality here.
investing less than half an hour into Search function can save hours or days of waiting for a solution