[#838] Use generate_medium_media_query instead of $*desktop_media_query

Fixes #838
Merge pull request #863 from afuna/generate_medium_media_query-bug-838

[#838] Use generate_medium_media_query instead of $*desktop_media_query