Make modal display grid dynamic