added gallery support