fixed buffer to use ImageStruct