Camera issue, photos are totally messed up sometimes

Could you install the Open Camera app to see if with that app you get better pictures?
If the Open Camera app doesn’t improve your pictures, you could consider to remove the camera itself and clean the contacts. video how to remove the camera module