This function is moved to LightboxHelper class.