added gallery code in an ugly state