as from swift 3 version , Swift Standard Library includes Foundation framework classes without 'NS' prefix; so since you are using URLSession instead of NSURLSession, you must use URL instead of NSURL to make both classes compatible with each other in URLSession instance method 'dataTask(with:completionHandler:)'.
just declare url as
let url = URL(string: profileImageUrl)
and done.