When the feature layer is created if you look at the renderer's symbol you'll see that the properties "url" and "imageData" swapped their values!
You could repro this by putting a break point on this line: featureLayer.__popupInfo = popupInfo // A semicolon is missing here btw - not a good JS practice:) and examine the symbol of the renderer.