why should you? that's not a very nice solution 😉
can't you create the picture and save it on the server as long as the session exists, and delete it by the session's garbage collector (you could alter the 'gc' by session_set_save_handler()😉 ?
if you really want to store the image in the session, perhaps you could try this ... but it's not tested and i'm not sure if it works 🙂
(...) // some code
ob_start();
imagejpeg(); // your picture you are creating
$_SESSION['image'] = ob_get_contents();
ob_end_clean();
(...) // more code