Export image file from bytea column
It's a horrible idea to store jpegs in the database.

That said, if you want to get it out of the database, you can use psql. This gets it out as hex. 

psql -t -A -o "/tmp/imagetest.jpg" -c \
  "SELECT photo FROM users_data_circulation LIMIT 1";


You may also want to check out the large object.