imageoverlay: Check if image structure is correctly formatted

Change-Id: I096ea28df01d532dd0d5881c780f5e13cd215670