This function is moved to LightboxHooks class.