initial gallery code completed