Why the gimbal position changes during taking photos?

Hi forum!

I need to know how correct this problem. During a flight, every flight to be exact, the gimbal turns at the side and take a photo! It’s a wrong photo equivalent to no photo taken as you can see in this processing in Pix4D (I fly with dronedeploy but generate a DSM with Pix4D

What can you advice to me?