added unless imgfile.nil?