Updated comments, namespaced global vars etc.
Separated presentation from logic.

Added fallback image.

Added web path global.