File imageFile = new File(imagePath);
imageFile.delete();
// Also remove the IMX file
String encoding = entry.getEncoding();
ImageEncoderManager manager =
ImageEncoderManager.getDefaultImageEncoderManager();
String extension = manager.getImageExtension(encoding);
// Build up the path for the IMX file
String imxPath = imagePath.substring(0,
imagePath.length() - extension.length());