Split image decoding functions into separate file.

Also ran GoFmt over the whole code base.