Added smarter rendering to the image class.