flatten imageData