making modal work with gallery style images also