Added image encoding