Check if CACHE/MEDIA exists.

When using GZIP, it does not check if APPLICATION/CACHE/MEDIA folder exists.  Refactored code so it checks for the cache-media folder and creates it if needed.