CRM-12965, fixes for layout based on image
Merge pull request #1136 from kurund/CRM-12965

CRM-12965, fixes for layout based on image