1. An image forming apparatus, comprising: an exposure head that includes a plurality of imaging optical systems that are arranged in a first direction and a plurality of light emitting elements that emit lights to be imaged by the imaging optical systems; a latent image carrier that moves in a second direction orthogonal to or substantially orthogonal to the first direction and carries a latent image formed by the exposure head; a developer that develops the latent image; a controller that controls the exposure head and the developer to form a test image so that a width of the test image will have a wider width than that of an image formed by one imaging optical system in the first direction; and a detector that detects the test image.