Made Image grid easier to deal with

Made conditional CSS to automatically handle margins. See code for
analysis.