Replace data urls with dataIds on the client side