You missed the dot:
$newfilename = rand(1,99999) . '.' . end(explode(".",$_FILES["image_file"]["name"]));
Basically you generate a random number, add a dot to separate the extension and then slice the original filename by dots and take the last part (which should be the extension itself). The extension is without the dot and you add it to what you already prepared.
Don't forget that random number will not generate a unique filename.It's possible that you'll overwrite your old files. And the more files you have the more this can happen.
To avoid this you can use a timestamp insteaf of (or together with) random number. This way you'll be sure that every second the filename will be unique:
$newfilename = time() . '_' . rand(100, 999) . '.' . end(explode(".",$_FILES["image_file"]["name"]));
The timestamp and three random numbers separated by underscore should be fine.