fixes done for Template galleries

Fixed up the changes suggested by