Add unit tests to the image optimization mojo.

Signed-off-by: Clement Escoffier <clement.escoffier@gmail.com>
Added javadoc

Signed-off-by: Clement Escoffier <clement.escoffier@gmail.com>