UNO: iterate over objects in Impress slides

How to iterate over objects inside slides, such as e.g. images, tables, etc?

For example, the code below connects to Impress, and retrieves 1st slide. But, how do I e.g. get images on this page?

#!python
import uno

# run libreoffice as:
# soffice --calc --accept="socket,host=localhost,port=2002;urp;StarOffice.ServiceManager"

def connectToLO():
    # get the uno component context from the PyUNO runtime
    localContext = uno.getComponentContext()
    resolver = localContext.ServiceManager.createInstanceWithContext(
        "com.sun.star.bridge.UnoUrlResolver", localContext )
    # connect to the running office
    ctx = resolver.resolve( "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext" )
    smgr = ctx.ServiceManager
    desktop = smgr.createInstanceWithContext( "com.sun.star.frame.Desktop",ctx)
    return desktop.CurrentComponent

model = connectToLO()
slide1 = model.DrawPages.getByIndex(0)
print(slide1.Name)

The document should implement com.sun.star.drawing.XDrawPagesSupplier interface. It allows to get access to com.sun.star.drawing.XDrawPages; the latter gives indexed access to individual com.sun.star.drawing.XDrawPage; and that interface gives indexed access to individual shapes.

So in essence, you get access to elements on the slide1 using

slide1.getByIndex(n)

Anyway, I would suggest you to look at APSO extension (and the introspection tools mentioned there).