Remove redundant dimensions in image filenames.