Add image optimization pre-commit plugin

Change-Id: I0817b9ff0b392d6e30b4c268d1a7a71e836123b8
Reviewed-on: https://gerrit.causes.com/30488
Tested-by: jenkins <jenkins@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>
Make image optimization check compatible with 1.8.7

Change-Id: I2d48b1934546838f723e1f60d690273c5cd5b232
Reviewed-on: https://gerrit.causes.com/30489
Tested-by: jenkins <jenkins@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>