Added functionality to parse returnimage data as well as other modifications