File removing in Android, not removing the Image completely. White thumbnail is reatained

Hi, I’m trying to remove the Image after processing it. According my requirement, the image should not be stored in the phone’s memory.
A similar version of Ionic code I’m using:

var path = "file:///storage/emulated/0";
var filename = "myfile.img";

window.resolveLocalFileSystemURL(path, function(dir) {
	dir.getFile(filename, {create:false}, function(fileEntry) {
                  // The file has been removed successfully
                  // Error deleting the file
                 // The file doesn't exist

Image gets removed successfully, but when gallery is opened, I see blank white thumbnails, which are not viewable. I need to get rid of them. It works fine with video, no residual file is maintained.
Can anyone please help me ?