Opens a file and converts it into an image