I suspect you'll need something like this in there somewhere. You have a blob of bytes, you need to convert it back and using a fileStream and a binary writer can help you do that.
fs = new FileStream("logo" + pub_id + ".bmp", FileMode.OpenOrCreate, FileAccess.Write);
bw = new BinaryWriter(fs);