You could place all of the images in a counter folder and label them 0.[image], 1.[image] so on and so on... where [image] is gif or png what ever....
Now when you read the text file 0034 parse the string into an array. Check out the split() function.
Then echo out something like
<IMG src="<?php echo arr[0]; ?>.gif" />
<IMG src="<?php echo arr[1]; ?>.gif" />
<IMG src="<?php echo arr[2]; ?>.gif" />
<IMG src="<?php echo arr[3]; ?>.gif" />
This isn't perfect but you get the idea.....