fix a file name parse error

The sentence os.path.splitext('....jpg') will return a tuple
('....jpg',''), and the PIL cannot process a file without extension.