Move figure-modal logic to its own controller.