Here I wrote a 'quick & dirty' script.
I assume that all images were placed into rectangles: not ovals, polygons, etc. If this is not the case, remove lines 13 and 15.
Before

After

You can Undo/Redo the whole script

var scriptName = "Remove links",
doc;
app.doScript(PreCheck, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "\"" + scriptName + "\" script");
//===================================== FUNCTIONS ======================================
function Main() {
var links = doc.links;
if (doc.links.length == 0) ErrorExit("The document has no links.", true);
for (var i = links.length-1; i >= 0; i--) {
try {
if (links.parent.parent.constructor.name == "Rectangle") {
links.parent.remove();
}
}
catch (err) {
//$.writeln(i + " - " + err);
}
}
}
//--------------------------------------------------------------------------------------------------------------------------------------------------------
function PreCheck() {
if (app.documents.length == 0) ErrorExit("Please open a document and try again.", true);
doc = app.activeDocument;
if (doc.converted) ErrorExit("The current document has been modified by being converted from older version of InDesign. Please save the document and try again.", true);
if (!doc.saved) ErrorExit("The current document has not been saved since it was created. Please save the document and try again.", true);
Main();
}
//--------------------------------------------------------------------------------------------------------------------------------------------------------
function ErrorExit(error, icon) {
alert(error, scriptName, icon);
exit();
}
//--------------------------------------------------------------------------------------------------------------------------------------------------------
Here in the Links section I posted a similar script which removes only missing links.
Hope it helps!
— Kas