Private equity firm Apollo Global Management is going big on online photos.

The company announced late Monday that it’s buying Shutterfly and Snapfish, and would combine the two photo businesses if the deals goes through.

The deal for Shutterfly at $51 a share values the company at $2.7 billion. Its shares are down 0.7% in premarket trading. Snapfish is not publicly traded.

The 20-year-old company Shutterfly became popular offering its users prints and photobooks of their favorite shots. But demand for that type of service has declined as people opt to share photos online through Facebook and other social networks.

Redwood City, California-based Shutterfly’s stock closed at $50.25 on Monday — and was trading as high as $94.28 per share a year ago.

Ryan O’Hara, the former CEO at real estate company Move Inc., will become Shutterfly’s new chief executive.

Shutterfly bought competitor’s Kodak’s online photo business for $23.8 million in 2012 after the legacy photo company filed for bankruptcy protection earlier that year.

Shutterfly announced it would lay off about 260 employees, or 13% of its staff, in early 2017. It bought school photography company Lifetouch for $825 million last year.

Apollo has bought more than 150 companies, including security company ADT, entertainment restaurant Chuck E. Cheese’s and telecom firm Charter Communications.