The Portrait in a Pickle side quest in Hogwarts Legacy can be obtained during the Lodgok’s Loyalty main quest. Travel to the Library Floo Flame then interact with the nearby portrait of Ferdinand Octavius Pratt. He’ll inform you that his other frame has been stolen and will task you with recovering it.
Travel to the Three Broomsticks in Hogsmeade then speak with Astoria Crickett near the entrance. She’ll mention that the portrait is being kept with the people who stole it. Travel to the Marunweem Ruins at Marunweem Lake and deal with the enemies there. In the ruins, find the set of stairs next to a stack of barrels and take them down.
You’ll need Alohomora Level II to pick the lock of the gate. Once inside, speak with the portrait. Afterwards, you’ll have the option of returning it to the Three Broomsticks or Hog’s Head. Do whatever you see fit to the portrait. The quest will complete and you’ll be rewarded with an Oddities Shelf configuration.