added check to see if media file exists before downloading media files