add grid layout to media elements.