Background image via code

Isn’t it possible to add an option with PHP code
For exemple, to import via ACF relationship an image with the belowed code.
The main advantage is to set the background image size via the DIV that has no effect if the image is displayed via a Code Block inside the DIV (the sizemust be dimensionned in the code).

<?php
$field = '';
$fields = '';
$fields = get_field('clubrecevant');
if( $fields ) {
		foreach( $fields as $field ){
				$field_id = $field->ID;
				$image = get_field('_thumbnail_id', $field_id);
				if( $image ) {
					$thumb = $image['sizes'][ 'thumbnail' ];
					echo '
					<div>
						<img src="' . esc_url($thumb) . '" width="80px" height="100%"  />
					</div>';
				}
		}
}
?>