Update utils.py

Bug fix when file extension is uppercase