/**
     * @param eZContentObjectTreeNode $node
     * @param integer $mediaCase
     * @return boolean
     */
    public static function hasImageArticle($node, $mediaCase)
    {
        // Way to know if an image exists for the article via solr
        if ($node == null) {
            return false;
        }
        $params = array(
            'MediaCase'       => $mediaCase,
            'ArticleObjectId' => $node->attribute('contentobject_id'),
            'ArticleLanguage' => $node->currentLanguage(),
            'Alias'           => false,
        );

        try
        {
            $imageHandler = new ImageArticleTool($params);
        }
        catch ( Exception $e )
        {
            return false;
        }

        return $imageHandler->hasImage();
    }
<?php

/* @type $Params string[] */

// Definition : $Params = array ( MediaCase, ArticleObjectId, ArticleLanguage, Alias, Variation )

try
{
    $imageArticleTool = new ImageArticleTool ($Params);
    $imageArticleTool->initImage();
    $content = $imageArticleTool->getImageContent();

    if ( strlen($content) == 0 )
        throw new Exception( 'Content is empty' );

    header( 'Content-Type: ' . $imageArticleTool->getImageMimeType() );
    header( 'Content-Length: ' . $imageArticleTool->getImageSize() );

    echo $content;
}
catch ( Exception $e )
{
    $context = ContextTool::instance();
    if ( !($context->environment() & ContextTool::ENVIRONMENT_PROD) )
    {
        eZLog::write( $e->getMessage(), 'article_image.log' );
    }

    $statusReason = HttpTool::$statusReason[404];
    header( "{$_SERVER['SERVER_PROTOCOL']} 404 {$statusReason}" );
}