Compressed and Corrupted image issue

While downloading the uploaded image in the Document/Notes module, the image was compressed and sometimes distorted.


Steps to reproduce-

1- Create a document record, fill in the required field
2- Upload JPG image
3- Save the record
4- Downalod the uploaded image

Expected results:
Upload the Image with the original size image

Actual result:

The image was compressed and sometimes distorted


Same issue with the Inbound Email attachment

Thanks