Updated code to check for uploads directory.