if (l.hasDXFEntities(DXFConstants.ENTITY_TYPE_IMAGE)) {
Iterator<DXFEntity> in = l.getDXFEntities(DXFConstants.ENTITY_TYPE_IMAGE)
.iterator();
while (in.hasNext()) {
DXFImage img = (DXFImage) in.next();
String imgDef = img.getImageDefObjectID();
DXFImageDefObject def = (DXFImageDefObject) doc.getDXFObjectByID(imgDef);
File f = new File(def.getFilename());
if (!f.exists()) {
in.remove();