added pinterest style behaivor to modal windows