Added more gallery support and fixes.