The magic a portrait or photograph can show depends on two main factors.
The first is its creator.
Portraits in the Daily Prophet, or the photographs that Professor Gilderoy Lockhart once plastered all over the Defense Against the Dark Arts office, all show a certain degree of magic… though only enough for casual movements—waving, gesturing, or repeating hollow slogans.
The portraits hung throughout the school, such as the Fat Lady or Sir Cadogan, possess far greater magic thanks to the more powerful enchantments cast by their artists. They retain some awareness and can speak with wizards quite naturally.
The second factor depends on the power the wizard possessed during their lifetime.
Generally, the more powerful the wizard, the stronger the magic retained in their portrait after death.
Take the portraits of the former Headmasters, for instance… Not only do they possess independent awareness, but they also retain the memories they had when alive. They can move freely between the various portraits throughout Hogwarts, and even pass between different portraits of their own—regardless of whether one hangs an ocean away.
Every Headmaster in Hogwarts' history was a wizard of considerable renown, most of them occupying lengthy entries in A History of Magic. After a Headmaster stepped down or passed away, their portrait was typically painted by the most skilled artists and then placed upon the wall of the Headmaster's Office.
Thus, these portraits retain the personalities and memories their subjects had in life. They can offer guidance to the current Headmaster at their own discretion and—using their ability to travel between portraits—deliver messages on the Headmaster's behalf.
Of course, not every Headmaster's portrait hangs in the office. The tradition of placing a deceased Headmaster's portrait here began in 1098, proposed on his deathbed by Brian Gagwilde, Hogwarts' fourth Headmaster. Every Headmaster since has upheld that tradition.
The first three Headmasters lived before this custom, so the uppermost section of the portrait wall holds three empty frames.
...
Jon patiently finished tidying the portrait wall, removing dust from every frame.
Looking at the jubilant former Headmasters embracing and celebrating, and listening to the bubbling noise of their chatter, Jon could only shake his head helplessly. He turned toward the other side of the room.
"Reparo!"
Jon waved his wand, and the scattered silver instruments returned to the table, restored to their original condition.
After about fifteen minutes of work—once the last silver mouse had been safely placed back onto the desk—the Headmaster's Office appeared to have regained its former look.
Unfortunately, Professor Dumbledore was no longer here; nor was there any sign of Fawkes near the phoenix perch.
"So this is why Professor Dumbledore called me to his office—just to make me the cleaner?" Jon muttered, plopping himself down into Dumbledore's chair.
The cushion beneath him was soft and springy—surprisingly comfortable.
While he sat, Jon idly pulled open one of Dumbledore's drawers, wondering whether the dear Headmaster had left anything behind.
The left drawer was filled with all sorts of candy—every variety sold at Honeydukes was represented.
Jon grimaced and shut the drawer. He opened the right one next, finding a brand-new pair of wool socks. He shut it immediately, deciding not to pry into Dumbledore's privacy.
Then Jon approached the bookshelf beneath the phoenix perch. He opened its doors, revealing hundreds of neatly organized volumes. These were the personal collections of Hogwarts' former Headmasters. Jon had once taken a book from here—Secrets of the Darkest Art… no, wait, that had been a gift from Dumbledore.
Jon had wanted these books for ages… Many of them couldn't even be found in the Restricted Section.
But with Dumbledore gone now, Jon no longer intended to restrain himself. At the moment, he was thinking about how to avoid drawing the Headmasters' attention and sneak one or two volumes back to his dormitory.
As he pondered, he opened a book titled Top-Tier Potions: Techniques for Improving Your Felix Felicis Success Rate.
...
Half an hour later, Jon finally tore himself away from the dense text.
He had already stayed in the Headmaster's Office for quite some time. Any longer and someone might find it suspicious… As the Headmaster's Assistant, disappearing from among the Slytherin students for too long would look odd.
Worse, his Slytherin friends might think he'd been attacked by some furious Gryffindor and start searching the entire castle for him.
As Jon stood up, he casually slipped the book, Top-Tier Potions, inside his robes.
"Books from this room are not to be removed," came Headmaster Phineas Black's lazy voice behind him.
"Dear Headmaster Black…" Jon quickly forced a smile. "Perhaps you could make an exception?"
"No!" a stern voice thundered from the top of the portrait wall.
Seeing Headmaster Oliver Cromwell's dark expression, Jon immediately put the book back.
"You can always return tonight to keep reading!" Phineas Black continued in his languid tone. "If I remember correctly, Armando is a potions expert. I once took the Felix Felicis he brewed… It felt absolutely heavenly! He could give you a pointer or two."
"Indeed," said Armando Dippet weakly, nodding along.
"But I don't have a legitimate reason to come here at night," Jon said, shaking his head in frustration.
"That's simple!" Phineas Black perked up instantly. "Why not craft your own Invisibility Cloak? When I was young and exploring Algeria, I made one myself. It helped me escape countless—"
"You've bragged about that story a million times, Phineas. Aren't you tired of hearing yourself?" scoffed Headmaster Dexter Fortescue. "Besides, making an Invisibility Cloak requires the full hide of an Demiguise. Where do you suppose Jon is going to find one?"
"Listen to me, kid—you should learn the Disillusionment Charm. It's not as good as an Invisibility Cloak, but it's more than enough to fool people in the middle of the night…" Headmaster Dexter Fortescue continued, looking far too enthusiastic.
