Improved GetImageFile.m