Hi Florian, thank you so much for your quick reply! It works!

I adjusted the code a bit more so that the image also needs to be the first block of the post content:

$img_block_counter = 0;

foreach ( $blocks as $block ) {
if ( $blocks[0]['blockName'] === 'core/image' ) {
if ( $block['blockName'] === 'core/image' && $img_block_counter === 0) {
$img_block_counter++;
continue;
} else {
$content_markup .= render_block( $block );
}
} else {
$content_markup .= render_block( $block );
}
}