post->post_content filter

You use preg_replace function incorrectly. This function returns replaced content:

add_filter( 'the_content', 'wpdu_image_replace' );
function wpdu_image_replace( $content ) {
    return preg_replace( '/<img.*?src="https://wordpress.stackexchange.com/questions/55241/(.*?)".*?>/', '<a href="$1">Image file</a>', $content );
}

Also pay attention that you don’t have to use global variable $post, because content of the post is passed to your function as first argument.