modified edition of gallery2