(CBS) — A pug is back home after police in a New Jersey shore town posted her mugshot social media, asking for help finding its rightful owner earlier this week. Bean the pug was caught wandering around in a stranger’s backyard and was taken in Sunday by the Cape May Police Department.

Cape May Patrolman Michael LeSage retrieved Bean after responding to a call of a dog in a yard. He told NJ.com he tried to get her to hop in the back of his police car, but “but her short little legs couldn’t make it into the car, so I had to lift her up.”

The Cape May Police Department took a mugshot of Bean and published it on Facebook, hoping to reunite her with her family. They captioned the photo: “This is what happens when you run away from home. This guy was captured sneaking through yards on the 1300 block on New Jersey Avenue.”

The “pugmug” quickly went viral, amassing more than 5,000 “likes” and almost 10,000 shares.

Police continued to have fun at Bean’s expense. Hours later, they posted a photo of the pug inside a jail cell along with an update.

“The pug’s owner has been located, and [s]he has been released on bail,” police said. Cape May PD revealed bail was “paid” in the form of cookies.

Hadley Hubbard, Bean’s owner, expressed her gratitude to police on Facebook.

“Thank you CMPD from Bean the pug’s family for tacking such good care of her,” Hubbard wrote. “She is sound asleep after an exciting after on the run.”