Swift implementation of YLGIFImage