I've seen this in the CR publish procs:
db_blob_get_file wmb_get_blob_file "
select content from cr_revisions where revision_id = $revision_id
" -file $filename
Maybe a long term solution for your problem could be to take out all of your images to the file system. HTH.