get_media now creates cache/ if it does not exist and validates downloaded file integrity