Hi Sivandri Sirisha,
can you tell us a bit more about your workflow?
How do you determine, if a graphic frame is not needed anymore?
Are there distinct differences between a not needed graphic frame other than not containing an image?
Maybe an applied object style? Maybe a distinct fill color or stroke width? Something that is unique to your graphic frames holding images?
I have used 20 image boxes in design file which are dynamic using XMPIE uPlan. I am using two different Object Styles for the image boxes alternatively. The image box should remove/hide when there is no image in the image box.
Do you know why XMPIE uPlan is creating empty graphic frames?
I'm not familiar with that tool. Maybe you can find a way to prevent this.
I see a chance, that a script can do what you want iterating the allPageItems array and checking all graphic frames if the said Object Styles are applied and will not contain any images.
I don't know your layout, so I cannot tell, if there any side effects removing those frames. There might be some, if you have to write back data to the tool.