Your problem is writing to a stream and then reading an image from it. At the start of reading of the image, your position in stream is at the very end; so there is nothing to read, which throws an exception. Rewind the stream back to the beginning, reopen it.
You don't need to write bytes to the stream, they are already there. Use this constructor, with one parameter:
http://msdn.microsoft.com/en-us/library/e55f3s5k.aspx[
^].
After that, just read the image.
—SA