Conditional tag doesn’t work in WordPress plugin

Both those hooks are too early to use is_page(). WordPress hasn’t determined which page is being loaded yet, so it can’t check the current page. Try template_redirect for both:

/**
 * Plugin Name: Test1234
 */
function replace_image_content(){
    if ( is_page( 'img' ) ) {
        header( 'Content-Type: image/jpg' );

        $image = plugin_dir_url(__FILE__) . '1404-1.jpg';

        readfile( $image );

        exit;
    }
}
add_action( 'template_redirect', 'replace_image_content' );