Fixed crash when retrieving image as linear array of pixels