adding dialog box to gallery