Permanently delete file from Google Drive.
When using insertImage() function, to prevent clone sheets from becoming a massive dump in the trash, please mind if add this piece of code.
Thank you for your pull request. About changing DriveApp.getFileById(tmpId).setTrashed(true); to Drive.Files.remove(tmpId);, Drive.Files.remove sometimes occurs an internal error. I'm worried that this might be related to the process of the file. But I have no clear information about it. So, I used DriveApp.getFileById(tmpId).setTrashed(true);. I deeply apologize that this was not your expected result.
Now, I came up with a direction. In this case, how about including Drive.Files.remove as an option? The default uses DriveApp.getFileById(tmpId).setTrashed(true);. When the option is used, Drive.Files.remove is used. How about this?