Fixed so if there are no uploaded files the script doesn't fail.