Make gallery work with GIF.