fixes to image parsing
merge