optimize media tags query for media.csv
Merge branch 'master' into RELEASE_20130723