Image preloader helper

Feel like this needs some tests, but I don't know how to test that a image is loaded... 
Ah, sorry, I didn't get you the first time. I've added error handling for that.