Well, my bad.
In case anyone makes the same mistake:
I should have used the ByteArrayEntity class instead of the StringEntity one:
ByteArrayOutputStream baos = new ByteArrayOutputStream();
photo.compress(Bitmap.CompressFormat.JPEG, 100, baos);
byte[] imageBytes = baos.toByteArray();
//http put body
ByteArrayEntity be = new ByteArrayEntity(imageBytes);
putRequest.setEntity(be);
I was trying to convert the bytearray into a string and send it, the correct way to do it is to use the ByteArrayEntity class.