Updated GalleryElement to use static canvas and context