Barrel distortion may occur when taking photos at the widest angle of a lens. The wider the angle, the greater the lens distortion.
The position of the camera lens causes images to look outwardly curved or skewed when straight edges are near the side of the frame. Lines that you’d expect to appear perpendicular are not.
While not all barrel distortion looks bad and may even be desirable at times, you can minimize its effect by moving back and zooming with you lens in instead of standing close and shooting at wide angle.
Use a focal length of about 50mm (35mm equivalent). You can actually watch the LCD for distortion as you zoom or change your physical distance from the set-up. If things appear distorted, move back from the subject and zoom in.