remove imageData as a separate variable