You want to use $_GET["ok"] for file.php?ok=name. This will return "name."
As for using this in the <img>, you probably don't have $file in PHP. Instead, use something like this:
<img src="<?PHP=$file ?>">
This is the exact same thing as:
<img src="<?PHP echo($file); ?>">, just shorter.
There was more in your post that I didn't quite understand. What's not stated in my reponse, could you rephrase?