While fetching images using fetch XML there is a possibility that you will not able to get the complete image. You will also notice that these issues generally happens when you are using multiple internal entities.
We were working on a project where we displaying the records notes using the multiple entities, we noticed that it is not showing the complete images, but it is truncated or incomplete.
Let’s see the actual query and the output
In the below query we are getting the incomplete images as a base 64 string.
In the below fetch xml we are getting complete image
If you will closely look into the query distinct parameter for the first was true whereas in the second case it was false.
Hope this helps you to retrieve the complete image and not the truncated one