Move some duplicated stuff into the lightbox base class.