fix to avoid recreating imageData buffer on every frame