How can I retrieve the image which is stored in bytea column of a pg_toast schema?
Certain graphical DB clients will show you the image when going to the table data view.  In plain query output (for example in psql), though, you cannot expect images to appear.  Otherwise, you have to 'decode' the bytea.  

Here is an example solution (written in PHP) on gis.stackexchange.com:

$conn = pg_connect("...");
$res = pg_query($conn, "SELECT chunk_data AS photo FROM photo WHERE ...");
$raw = pg_fetch_result($res, 'photo');
header('Content-type: image/jpeg');
echo pg_unescape_bytea($raw);


Note:

pg_toast is not usually a schema you query directly from.  What is stored there has a 'parent' table, do your queries against it instead.  Then you can possibly use sane column names in your queries, and so on.