You can always check how the ODT export uses the UNO API to write the images. See the code here:
So you can do a .createContentEnumeration(“com.sun.star.text.TextContent”) on the text portion object, which will give you an enumeration of typically a single image, and there you can set e.g. the Size property.