factor out image related code from File into File::Image