I would strongly advise against serving images from MongoDB.
It would be better to save them on a static filet (S3) and possibly save the path in MongoDB.
You would probably use base64 encoding to put the file in mongodb: http://www.greywyvern.com/code/php/binary2base64/ (or just the base64 shell utility).
If you use ordinary documents, then the cost of execution is relatively low (as long as caching is good). If you use a mixed database, where you have GridFS and regular documents, you will need a lot of RAM on your server (s). GridFS queries will run completely differently than document queries.
:
var base64Data = imagefile.replace(/^data:image\/png;base64,/,""),
var dataBuffer = new Buffer(base64Data, 'base64');
db.foo.insert({magic: 123, etc... img: dataBuffer.toString()})