I use two layers of thin black foam. The top layer of foam sheet has cut-outs for the various types of media except microSD card, which is held in place with a small dab of glue. They're pressed against the glass and has survived 2 moves without issue.
As a technical person, my mind keeps getting blown.