Update utils.py

Fixing unicode encoding of name when upload_to gets a function and not a string as argument.