added download image functionality