Added function for drawing images