Possible, but unloading cargo would be more involved. Also, without access to electronic manifests, I am not sure there's any easy way to know what's in a container, not to mention many of them would be stacked in such a way as to inaccessible. All of which is a lot harder than ransoming a crew. I suppose it might be possible for pirates just to threaten to sink the ship.