on a Page or PageRef you could use the method getOutgoingReferences to get all elements referenced by your Page or PageRef. In a second step you could iterate over these elements to check if they contain media.
on a Page or PageRef you could use the method getOutgoingReferences to get all elements referenced by your Page or PageRef. In a second step you could iterate over these elements to check if they contain media.