We use Postgres too but in any case I wouldn't bother storing images in the database, I'd rather store them on disk and just store the path to the image. There may be very good reasons for storing images in the database but I haven't encountered any.