alloc encoder to select between custom and default image memory allocation