Either move them all from /images/1/15/image.ext to /images/image.ext and set to false $wgHashedUploadDirectory (easy) or move them the other way, for which you will probably need a script. The subfolder pattern is /images/a/ab/ where ab are the first 2 characters of the filename's md5.