iPhone jiggling camera / unstable camera

On some (older) models of iPhone I have noticed that sometimes the camera goes haywire and jiggles. Apparently this is a result of the gyroscope going haywire. This then affects things like StarWalk and anything else that needs the gyro. The fix is relatively simple: glue a tiny strong magnet to the case where the gyro is. Experiment with a magnet to see where the gyro is. On an iPhone 6 it is the top right corner.