Change
query.bindValue(":IMAGE", ba.data());
to
query.bindValue(":IMAGE", ba);

and make sure that the blob supports the size of the image. In MySQL it is very possible that instead of BLOB you may need LONGBLOB. In SQLite I think there's no problem.
The above code works fine for me for a long time now