На скорую руку нашел простое решение:
require_once(dirname(__FILE__) . '/../' . 'bootstrap.php');
Core_Session::start();
// value 1
$numOne = rand(1, 9);
// value2
$numTwo = rand(1, 9);
// total
$numero = $numOne + $numTwo;
// math string
$display = $numOne . '+' . $numTwo . ' =';
// set session variable to total
$_SESSION['check_number'] = $numero;
$img = imagecreate( 75, 35 );
$background = imagecolorallocate( $img, 255, 255, 255 );
$text_color = imagecolorallocate( $img, 55, 37, 41 );
$text = $display;
$font = 'verdana.ttf';
imagettftext($img, 16, 0, 0, 26, $text_color, $font, $text);
header( 'Content-type: image/png' );
imagepng( $img );
imagecolordeallocate( $img, $text_color );
imagecolordeallocate( $img, $background );
imagedestroy( $img );
Выглядит так: