Fix a nil dereference in buildfile_test.go

The test runtime object wasn't properly initialized.
Always return the correct test image.

And not a *random* one from its history.
Merge pull request #1052 from lopter/master

Fix a couple critical bugs on the test suite