1. A sewing machine comprising: an embroidery frame moving device that moves an embroidery frame holding a work cloth; an image pickup device that picks up images of an upper surface of a bed portion of the sewing machine; a position information storage device that stores position information indicating respective predetermined positions to which the embroidery frame is to be moved; a partial image acquisition device that: causes the embroidery frame moving device to move the embroidery frame to the respective predetermined positions indicated by the position information, causes the image pickup device to pick up images at the respective predetermined positions, and acquires the images picked up by the image pickup device as partial images; and a composite image generation device that generates a composite image by correcting, based on a thickness of the work cloth, the partial images acquired by the partial image acquisition and combining the partial images that have been corrected.