Is it possible to force the listings take image from its upper category?

Hi!

I finally success to do it. Looking at the code I found a method to obtain the array of categories and I take the first one.

So finally I have change the original code line:

<img src="<?php echo esc_url( hivepress()->get_url() . '/assets/images/placeholders/image-landscape.svg' ); ?>" alt="<?php echo esc_attr( $listing->get_title() ); ?>" loading="lazy">

With this:

<?php foreach ( $listing->get_categories() as $category ) : ?>
	<img src="<?php echo esc_url( $category->get_image__url( 'hp_landscape_small' ) ); ?>" alt="<?php echo esc_attr( $category->get_name() ); ?>" loading="lazy" />
<?php break; endforeach; ?>

I have checked references and I still not find any doc/class/references related with the detail information about different methods, is there any concrete different to check?

Best regards!