I have a WebApp that collects work site data into a Google Sheets spreadsheet and also collects work site photos into a Google Drive folder that I create for each job. Some
Assuming you get the ID of your image in your drive, you can use a code like below to insert an image in the last row of a sheet (the url is a bit different than usual):
...
var img = DriveApp.getFileById('image ID');// or any other way to get the image object
var imageInsert = sheet.getRange(lastRow+1, 5).setFormula('=image("https://drive.google.com/uc?export=view&id='+img.getId()+'")');// in this example the image is in column E
sheet.setRowHeight(lastRow+1, 80);// define a row height to determine the size of the image in the cell
...
I would suggest that you carefully check the sharing properties of the files you are trying to show : they must be set to "public" of moved in a folder that is also "publicly shared"