Adding styling and logic to captions display.