before adding images to gridview