added merging of margins for advanced image styling