[TASK] Support more options in calculations

Currently the border setting and column spacing are not taken into account when the width of the images is calculated.

This patch fixes this by adding these options