Creating and save an image from a byte[] causes Parameter is not valid exception
I knew you had the answer you need but I just want to go on your original idea. I think the problem is your byte array somehow had been changed and become byte char array, you just need to add this code to make it become byte array again:
for (int i=0;i<imageByteArray.Length;i++){ imageByteArray[i]=(byte) imageByteArray[i];}
I had this problem and solved it by this solution. Good luck!