function resizeAllImages() {
//custom variable - update the desired width (in pixels)
var newWidth = 500;
//do not edit
var doc = DocumentApp.getActiveDocument();
var images = doc.getBody().getImages();
var imageCount = images.length;
for (var i=0; i<imageCount; i++) {
var width = images[i].getWidth();
var height = images[i].getHeight();
var newHeight = (newWidth / (width/height));
images[i].setWidth(newWidth);
images[i].setHeight(newHeight);
}
}