I'm aware this can be done with a recursive Twig macro if you're after a certain property of the ancestor, eg.:
TWIG
{% macro granddaddy_image(p) %},{% spaceless %}
{% if p.parent.root %}
{{ (p.media.images|first).url }}
{% else %}
{{ _self.granddaddy_image(p.parent) }}
{% endif %}
{% endspaceless %},{% endmacro %}
<img src="{{ _self.granddaddy_image(page) }}" alt="img">
Is there a way of quickly retrieving the highest-level ancestor page as an object?