1. The most important thing is to determine the encoding being used,
because there are many ways to turn an image into an array of bytes.
2. Another crucial thing is making sure your code isn't corrupting the data:
do you have units tests that verify the byte[] going into the database
is the same data as the byte[] you select out of the database?
Answer those two points first.