Porting carousel code into ui.php