The sky was not cleaned up before this view of Andromeda was assembled. Airplanes, satellites, cosmic rays, and faulty camera pixels all cross the galaxy.

Image: NASA Astronomy Picture of the Day (APOD) | Photography: Kees Scherer | Original page
Kees Scherer photographed the scene from a garden observatory in Portugal in 2019. He made 223 exposures, each lasting 300 seconds. Together they represent about 18 hours and 35 minutes of exposure time.
Stacking that much data brings out the faint outer structure of the Andromeda Galaxy, but it also accumulates temporary marks from the sky and the equipment. Bright parallel lines come from airplanes, long continuous tracks are left by satellites, short streaks can be caused by cosmic rays, and abnormal points fixed in place belong to faulty pixels in the camera sensor.
The "Before" Image Is Already a Composite
This is not a single frame produced by one press of the shutter. Deep-sky targets are dim, so astrophotographers commonly make many long exposures, align them, and combine their signal.
Andromeda is about 2.5 million light-years away. Airplanes fly within Earth's atmosphere. Satellites orbit Earth. Cosmic rays strike the camera detector, and bad pixels reside inside the camera itself. All appear in the same set of images even though they come from entirely different distances and mechanisms.
That makes "what the camera recorded" a different question from "what the target looks like." The first image faithfully preserves the observing process. Answering the second question requires comparing exposures to identify which signals remain aligned with the stars and which appear in only a few frames.
Removing Trails Does Not Invent a Galaxy

The processed version uses software including Astro Pixel Processor, DeepSkyStacker, and PixInsight to greatly reduce marks from airplanes, satellites, cosmic rays, and bad pixels. The title says "before Photoshop," but the actual work was not a matter of painting over each line in Photoshop.
Once many exposures are aligned to the same patch of sky, Andromeda's stars and clouds remain in stable positions while an airplane or satellite crosses only a few frames. Stacking software can compare the images and lower the weight of those outlying values or reject them.
This process also sharpens the meaning of "real." The uncleaned version is a true record of the photography site: traffic crosses Earth's sky and camera sensors are imperfect. The processed version serves a different observational goal by isolating more of the light that came from the distant galaxy.
Two Images, Two Questions
The first image asks what appears in nearly 19 hours of digital-camera exposure from the ground. The answer includes Andromeda and the marks left by the entire observing chain.
The second asks how the galaxy appears when interference from Earth's atmosphere, near-Earth orbit, and the camera itself is reduced. It makes the bright core, dark dust lanes, and outer distribution of stars easier to read.
Astronomical image processing does not detach a picture from observation. It separates signals with different sources. Keeping both the before and after versions makes that work visible: every clean patch of the final background comes from comparison across a large set of original exposures.
Sources
NASA Astronomy Picture of the Day: Original page; Kees Scherer: The Andromeda Galaxy in a Crowded Sky; NASA Science: M31, the Andromeda Galaxy.