fix for handling imgur API 404s - fixes #1126

also cleaned up a little whitespace and whatnot