small utility for image rendering