Refactoring and maxSize option

There should be ability to specify maxSize attribute for inlining. May be by default, it should be kbytes. Also adds basePath in case images are somewhere else.