Fixing image file extension issue