Converts images to javascript format.