Shutterstock purchased Giphy, the online library and maker of GIFs, from Facebook’s parent company Meta, the company said Tuesday, after a prolonged legal battle forced Meta to sell at a $262 million loss.