to avoid duplicate code between the drracket support for printing and
for write/display; also add a special case for 2htdp/image images
because they can be trusted across the boundary between DrRacket's
implementation and the user's program (as there is no way to embed
arbitrary code into a 2htdp/image image)