adds diagram image macros