FIXED : Modularize javascript code

- Modularize source code
- Max width/height value be loaded more flexible (not hardcode)