Manipulate selected image via macro

I would like to fill a document with many mugshots that all should get the same size. (The aspect ratio is the same in all of those images.) Is there a way to do this? Maybe use a macro? (recording a macro that does this, does not same to work (using Libreoffice 4.4.5.2))

Indeed, there is a ready-made example of the key aspect of such a macro, which is reading an image from a location and inserting it into a writer document. The example is available on the OpenOffice forum here. I have tested, it works fine. The essentials are the following:

oText = ThisComponent.Text
FileName = "/home/user/pictureName.jpg"
FileURL = convertToURL(FileName)
objTextGraphicObject = ThisComponent.createInstance("com.sun.star.text.TextGraphicObject")
Dim objSize as New com.sun.star.awt.Size
objSize.Width = 3530
objSize.Height = 1550
objTextGraphicObject.setSize(objSize)
objTextGraphicObject.GraphicURL = FileURL
oText.insertTextContent(ThisComponent.CurrentController.ViewCursor, objTextGraphicObject, false)

To insert into a table, you will need to use an object other than ThisComponent.Text. Here is LibreOffice 5.0 API description of InsertTextContent

Edit: re-added resizing code block from oo example

(if this answers your question, please accept the answer by clicking the check mark (image description) to the left)