Ensuring media download functions exists and adding try-catch block