Make sure the lens ribbon cable is properly seated in its connector. This can cause problems like you are experiencing. Remove the lens module and reconnect the ribbon cable. See if this improves your problem.
If this doesn't fix the problem you may have a bad sensor. Replacing the lens module will likely fix the problem assuming the camera is otherwise functioning normally.