improved region capture
cleanup imageRef capture code