Fixed some pretty serious memory leaks

Also added a function that gets image urls straight from the wallbase.cc
image search result page.