According to Professor E. Gadd, the first twenty one portrait ghosts and Boolossus (No. 22)[2] were released from their paintings by Boos under the command of King Boo. Luigi had to vacuum up all of the portrait ghosts (except for a few "optional ghosts" like Mr. Luggs) using the Poltergust 3000. Captured portrait ghosts would be returned to their paintings via the Ghost Portrificationizer. The frame and the style of the portraits would change depending on how many pearls Luigi acquired during the battle with the ghosts.
Instruction booklet description:"I collected famous ghosts from all over the world and turned them into paintings, but those darn Boos went and turned them all back into ghosts again! You've got to catch those ghosts so I can turn them back into paintings."