Applied hot fix for getting the correct media type issue. Was always returning 'screen' for the type which probably hasn't shown up as any issue because most of the time, 'screen' is correct.