Fine-toothed image API; many small fixes